/[gentoo-x86]/dev-ruby/rubygems/rubygems-1.3.6.ebuild
Gentoo

Contents of /dev-ruby/rubygems/rubygems-1.3.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Aug 3 16:07:36 2010 UTC (8 years, 8 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Un-hack rubygems. With the new version, we're patching only tests and one customisation, all clear for upstream, while we install our own defaults in a separate file exactly as upstream intended.
This new version installs in /usr/local rather than /usr, so that whatever the user installs, it's not going to collide or mess with Portage-installed gems. Also, we no longer do any per-implementation patching, and we only special-case Ruby 1.9 for what concern the auto_gem file (instead of keeping four copies of the same identical file in files/).
Documentation is not currently building right, but tests are executed (they fail for JRuby, that is known.
Note that the -r1 version has been dropped, so for ~alpha and ~arm (which will have to re-keyword -r2) this causes a faux-downgrade to 1.3.7, but the changes in -r1 only related to Ruby 1.9 anyway.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-ruby/rubygems/rubygems-1.3.6.ebuild,v 1.1 2010/04/03 06:42:03 a3li Exp $
4
5 EAPI="2"
6
7 USE_RUBY="ruby18 ree18 jruby"
8
9 inherit ruby-ng
10
11 DESCRIPTION="Centralized Ruby extension management system"
12 HOMEPAGE="http://rubyforge.org/projects/rubygems/"
13 LICENSE="|| ( Ruby GPL-2 )"
14
15 # Needs to be installed first
16 RESTRICT="test"
17
18 SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
19
20 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc64 ~s390 ~sparc ~x86 ~x86-fbsd"
21 SLOT="0"
22 IUSE="doc server"
23
24 # previous versions had rubygems bundled, so it would collide badly
25 RDEPEND="ruby_targets_jruby? ( >=dev-java/jruby-1.4.0-r5 )"
26
27 # index_gem_repository.rb
28 PDEPEND="server? ( dev-ruby/builder[ruby_targets_ruby18] )"
29
30 all_ruby_prepare() {
31 epatch "${FILESDIR}/${PN}-1.3.5-setup.patch"
32 # Fixes a new "feature" that would prevent us from recognizing installed
33 # gems inside the sandbox
34 epatch "${FILESDIR}/${PN}-1.3.3-gentoo.patch"
35 }
36
37 each_ruby_prepare() {
38 case ${RUBY} in
39 *rubyee18)
40 epatch "${FILESDIR}/${PN}-rubyee.patch"
41 ;;
42 *)
43 ;;
44 esac
45 }
46
47 each_ruby_install() {
48 # RUBYOPT=-rauto_gem without rubygems installed will cause ruby to fail, bug #158455
49 export RUBYOPT="${GENTOO_RUBYOPT}"
50 ewarn "RUBYOPT=${RUBYOPT}"
51
52 local gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')
53
54 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting sandbox,
55 # bug #202109. Since 1.2.0 we also need to set GEM_PATH
56 # for this reason, bug #230163.
57 export GEM_HOME="${D}${gemsitedir}"
58 export GEM_PATH="${GEM_HOME}/"
59 keepdir ${gemsitedir}/{doc,gems,cache,specifications}
60
61 myconf=""
62 if ! use doc; then
63 myconf="${myconf} --no-ri"
64 myconf="${myconf} --no-rdoc"
65 fi
66
67 ${RUBY} setup.rb $myconf --destdir="${D}" || die "setup.rb install failed"
68
69 doruby "${FILESDIR}/auto_gem.rb"
70 }
71
72 all_ruby_install() {
73 dodoc README || die "dodoc README failed"
74
75 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
76
77 if use server; then
78 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
79 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
80 fi
81 }
82
83 pkg_postinst() {
84 local gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')
85 SOURCE_CACHE="${gemsitedir}/source_cache"
86 if [[ -e "${SOURCE_CACHE}" ]]; then
87 rm "${SOURCE_CACHE}"
88 fi
89
90 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
91 eselect ruby set ruby18
92 fi
93
94 ewarn
95 ewarn "To switch between available Ruby profiles, execute as root:"
96 ewarn "\teselect ruby set ruby(18|19|...)"
97 ewarn
98 }
99
100 pkg_postrm() {
101 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
102 ewarn "to run in current shells because of missing auto_gem."
103 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
104 ewarn "or start new shells"
105 ewarn
106 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
107 ewarn "RUBYOPT"
108 }

  ViewVC Help
Powered by ViewVC 1.1.20