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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Dec 21 12:13:35 2009 UTC (9 years, 3 months ago) by a3li
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Purge old
(Portage version: 2.2_rc59/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.3.ebuild,v 1.2 2009/06/07 17:40:29 armin76 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 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~x86-fbsd"
19 SLOT="0"
20 IUSE="doc server"
21 DEPEND="=dev-lang/ruby-1.8*"
22 RDEPEND="${DEPEND}"
23 PDEPEND="server? ( dev-ruby/builder )" # index_gem_repository.rb
24
25 USE_RUBY="ruby18"
26
27 src_unpack() {
28 unpack ${A}
29 cd "${S}"
30
31 epatch "${FILESDIR}/${PN}-1.3.3-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 src_compile() {
38 # Allowing ruby_src_compile would be bad with the new setup.rb
39 :
40 }
41
42 src_install() {
43 # RUBYOPT=-rauto_gem without rubygems installed will cause ruby to fail, bug #158455
44 export RUBYOPT="${GENTOO_RUBYOPT}"
45 ewarn "RUBYOPT=${RUBYOPT}"
46
47 # Force ebuild to use Ruby 1.8
48 export RUBY="/usr/bin/ruby18"
49
50 ver=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["ruby_version"]')
51
52 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting sandbox,
53 # bug #202109. Since 1.2.0 we also need to set GEM_PATH
54 # for this reason, bug #230163.
55 export GEM_HOME="${D}/usr/$(get_libdir)/ruby/gems/${ver}"
56 export GEM_PATH="${GEM_HOME}/"
57 keepdir /usr/$(get_libdir)/ruby/gems/$ver/{doc,gems,cache,specifications}
58
59 myconf=""
60 if ! use doc; then
61 myconf="${myconf} --no-ri"
62 myconf="${myconf} --no-rdoc"
63 fi
64
65 ${RUBY} setup.rb $myconf --destdir="${D}" || die "setup.rb install failed"
66
67 dodoc README || die "dodoc README failed"
68
69 cp "${FILESDIR}/auto_gem.rb" "${D}"/$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') || die "cp auto_gem.rb failed"
70 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
71
72 if use server; then
73 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
74 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
75 fi
76 }
77
78 pkg_postinst()
79 {
80 SOURCE_CACHE="/usr/$(get_libdir)/ruby/gems/$ver/source_cache"
81 if [[ -e "${SOURCE_CACHE}" ]]; then
82 rm "${SOURCE_CACHE}"
83 fi
84
85 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
86 eselect ruby set ruby18
87 fi
88
89 ewarn
90 ewarn "This ebuild is compatible to eselect-ruby"
91 ewarn "To switch between available Ruby profiles, execute as root:"
92 ewarn "\teselect ruby set ruby(18|19|...)"
93 ewarn
94 }
95
96 pkg_postrm()
97 {
98 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
99 ewarn "to run in current shells because of missing auto_gem."
100 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
101 ewarn "or start new shells"
102 ewarn
103 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
104 ewarn "RUBYOPT"
105 }

  ViewVC Help
Powered by ViewVC 1.1.20