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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Fri May 13 17:38:02 2011 UTC (7 years, 11 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Remove old versions.

(Portage version: 2.1.9.42/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.5.ebuild,v 1.7 2011/03/07 12:01:33 armin76 Exp $
4
5 EAPI="2"
6
7 inherit ruby
8
9 DESCRIPTION="Centralized Ruby extension management system"
10 HOMEPAGE="http://rubyforge.org/projects/rubygems/"
11 LICENSE="|| ( Ruby GPL-2 )"
12
13 # Needs to be installed first
14 RESTRICT="test"
15
16 # The URL depends implicitly on the version, unfortunately. Even if you
17 # change the filename on the end, it still downloads the same file.
18 SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
19
20 KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
21 SLOT="0"
22 IUSE="doc server"
23 DEPEND="=dev-lang/ruby-1.8*"
24 RDEPEND="${DEPEND}"
25 PDEPEND="server? ( dev-ruby/builder )" # index_gem_repository.rb
26
27 USE_RUBY="ruby18"
28
29 src_prepare() {
30 epatch "${FILESDIR}/${PN}-1.3.5-setup.patch"
31 # Fixes a new "feature" that would prevent us from recognizing installed
32 # gems inside the sandbox
33 epatch "${FILESDIR}/${PN}-1.3.3-gentoo.patch"
34 }
35
36 src_compile() {
37 # Allowing ruby_src_compile would be bad with the new setup.rb
38 :
39 }
40
41 src_install() {
42 # RUBYOPT=-rauto_gem without rubygems installed will cause ruby to fail, bug #158455
43 export RUBYOPT="${GENTOO_RUBYOPT}"
44 ewarn "RUBYOPT=${RUBYOPT}"
45
46 # Force ebuild to use Ruby 1.8
47 export RUBY="/usr/bin/ruby18"
48
49 ver=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["ruby_version"]')
50
51 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting sandbox,
52 # bug #202109. Since 1.2.0 we also need to set GEM_PATH
53 # for this reason, bug #230163.
54 export GEM_HOME="${D}/usr/$(get_libdir)/ruby/gems/${ver}"
55 export GEM_PATH="${GEM_HOME}/"
56 keepdir /usr/$(get_libdir)/ruby/gems/$ver/{doc,gems,cache,specifications}
57
58 myconf=""
59 if ! use doc; then
60 myconf="${myconf} --no-ri"
61 myconf="${myconf} --no-rdoc"
62 fi
63
64 ${RUBY} setup.rb $myconf --destdir="${D}" || die "setup.rb install failed"
65
66 dodoc README || die "dodoc README failed"
67
68 cp "${FILESDIR}/auto_gem.rb" "${D}"/$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') || die "cp auto_gem.rb failed"
69 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
70
71 if use server; then
72 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
73 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
74 fi
75 }
76
77 pkg_postinst() {
78 SOURCE_CACHE="/usr/$(get_libdir)/ruby/gems/$ver/source_cache"
79 if [[ -e "${SOURCE_CACHE}" ]]; then
80 rm "${SOURCE_CACHE}"
81 fi
82
83 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
84 eselect ruby set ruby18
85 fi
86
87 ewarn
88 ewarn "This ebuild is compatible to eselect-ruby"
89 ewarn "To switch between available Ruby profiles, execute as root:"
90 ewarn "\teselect ruby set ruby(18|19|...)"
91 ewarn
92 }
93
94 pkg_postrm() {
95 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
96 ewarn "to run in current shells because of missing auto_gem."
97 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
98 ewarn "or start new shells"
99 ewarn
100 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
101 ewarn "RUBYOPT"
102 }

  ViewVC Help
Powered by ViewVC 1.1.20