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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Sat May 9 08:57:19 2009 UTC (9 years, 11 months ago) by a3li
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +1 -1 lines
FILE REMOVED
Long overdue purging of old versions.
(Portage version: 2.2_rc33/cvs/Linux x86_64)

1 # Copyright 1999-2008 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.2.0.ebuild,v 1.12 2008/12/02 22:36:35 ranger Exp $
4
5 inherit ruby
6
7 DESCRIPTION="Centralized Ruby extension management system"
8 HOMEPAGE="http://rubyforge.org/projects/rubygems/"
9 LICENSE="|| ( Ruby GPL-2 )"
10
11 # Needs to be installed first
12 RESTRICT="test"
13
14 # The URL depends implicitly on the version, unfortunately. Even if you
15 # change the filename on the end, it still downloads the same file.
16 SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
17
18 KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
19 SLOT="0"
20 IUSE="doc server"
21 DEPEND=">=dev-lang/ruby-1.8"
22 PDEPEND="server? ( dev-ruby/builder )" # index_gem_repository.rb
23
24 USE_RUBY="ruby18"
25
26 src_unpack() {
27 unpack ${A}
28 cd "${S}"
29
30 epatch "${FILESDIR}/${P}-setup.patch"
31 }
32
33 src_compile() {
34 # Allowing ruby_src_compile would be bad with the new setup.rb
35 :
36 }
37
38 src_install() {
39 # RUBYOPT=-rauto_gem without rubygems installed will cause ruby to fail, bug #158455
40 export RUBYOPT="${GENTOO_RUBYOPT}"
41 ewarn "RUBYOPT=${RUBYOPT}"
42
43 ver=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["ruby_version"]')
44
45 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting
46 # sandbox, bug #202109. Since 1.2.0 we also need to set GEM_PATH
47 # for this reason, bug #230163.
48 export GEM_HOME="${D}/usr/$(get_libdir)/ruby/gems/${ver}"
49 export GEM_PATH="${GEM_HOME}/"
50 keepdir /usr/$(get_libdir)/ruby/gems/$ver/{doc,gems,cache,specifications}
51
52 myconf=""
53 if ! use doc; then
54 myconf="${myconf} --no-ri"
55 myconf="${myconf} --no-rdoc"
56 fi
57
58 ${RUBY} setup.rb $myconf --prefix="${D}" || die "setup.rb install failed"
59
60 dosym gem18 /usr/bin/gem || die "dosym gem failed"
61
62 dodoc README ChangeLog TODO || die "dodoc README failed"
63
64 cp "${FILESDIR}/auto_gem.rb" "${D}"/$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') || die "cp auto_gem.rb failed"
65 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
66
67 if use server; then
68 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
69 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
70 fi
71 }
72
73 pkg_postinst()
74 {
75 SOURCE_CACHE="/usr/$(get_libdir)/ruby/gems/$ver/source_cache"
76 if [[ -e "${SOURCE_CACHE}" ]]; then
77 rm "${SOURCE_CACHE}"
78 fi
79
80 ewarn "If you have previously switched to using ruby18_with_gems using ruby-config, this"
81 ewarn "package has removed that file and makes it unnecessary anymore."
82 ewarn "Please use ruby-config to revert back to ruby18."
83 }
84
85 pkg_postrm()
86 {
87 ewarn "If you have uninstalled dev-ruby/rubygems. Ruby applications are unlikely"
88 ewarn "to run in current shells because of missing auto_gem."
89 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
90 ewarn "or start new shells"
91 ewarn
92 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
93 ewarn "RUBYOPT"
94 }

  ViewVC Help
Powered by ViewVC 1.1.20