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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (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.10: +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.6-r2.ebuild,v 1.10 2011/03/07 12:01:33 armin76 Exp $
4
5 EAPI="2"
6
7 USE_RUBY="ruby18 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 ~sh ~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="
26 ruby_targets_jruby? ( >=dev-java/jruby-1.4.0-r5 )
27 "
28
29 # index_gem_repository.rb
30 PDEPEND="server? ( dev-ruby/builder[ruby_targets_ruby18] )"
31
32 all_ruby_prepare() {
33 epatch "${FILESDIR}/${PN}-1.3.5-setup.patch"
34 # Fixes a new "feature" that would prevent us from recognizing installed
35 # gems inside the sandbox
36 epatch "${FILESDIR}/${PN}-1.3.3-gentoo.patch"
37 }
38
39 each_ruby_install() {
40 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
41 unset RUBYOPT
42
43 local gemsitedir=$(ruby_rbconfig_value 'sitelibdir' | sed -e 's:site_ruby:gems:')
44
45 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting sandbox,
46 # bug #202109. Since 1.2.0 we also need to set GEM_PATH for this reason, bug #230163
47 export GEM_HOME="${D}${gemsitedir}"
48 export GEM_PATH="${GEM_HOME}/"
49 keepdir ${gemsitedir}/{doc,gems,cache,specifications}
50
51 myconf=""
52 if ! use doc; then
53 myconf="${myconf} --no-ri"
54 myconf="${myconf} --no-rdoc"
55 fi
56
57 ${RUBY} setup.rb $myconf --destdir="${D}" || die "setup.rb install failed"
58
59 doruby "${FILESDIR}/auto_gem.rb"
60 }
61
62 all_ruby_install() {
63 dodoc README || die "dodoc README failed"
64
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 clear_source_cache() {
74 local gemsitedir=$(ruby_rbconfig_value 'sitelibdir' | sed -e 's:site_ruby:gems:')
75 SOURCE_CACHE="${gemsitedir}/source_cache"
76
77 if [[ -e "${SOURCE_CACHE}" ]]; then
78 rm "${SOURCE_CACHE}"
79 einfo "Cleared gem source cache."
80 fi
81 }
82
83 pkg_postinst() {
84 _ruby_each_implementation clear_source_cache
85
86 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
87 eselect ruby set $(eselect --brief --no-color ruby show | head -n1)
88 fi
89
90 ewarn
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 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
98 ewarn "to run in current shells because of missing auto_gem."
99 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
100 ewarn "or start new shells"
101 ewarn
102 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
103 ewarn "RUBYOPT"
104 }

  ViewVC Help
Powered by ViewVC 1.1.20