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

Contents of /dev-ruby/rubygems/rubygems-1.3.7-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Mon Aug 19 08:15:20 2013 UTC (5 years, 8 months ago) by mrueg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Cleanup rubygems-1.3.*

(Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key )

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.7-r1.ebuild,v 1.7 2011/09/14 16:14:25 jer 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 ~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="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_install() {
38 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
39 unset RUBYOPT
40
41 local gemsitedir=$(ruby_rbconfig_value 'sitelibdir' | sed -e 's:site_ruby:gems:')
42
43 # rubygems tries to create GEM_HOME if it doesn't exist, upsetting sandbox,
44 # bug #202109. Since 1.2.0 we also need to set GEM_PATH for this reason, bug #230163
45 export GEM_HOME="${D}${gemsitedir}"
46 export GEM_PATH="${GEM_HOME}/"
47 keepdir ${gemsitedir}/{doc,gems,cache,specifications}
48
49 myconf=""
50 if ! use doc; then
51 myconf="${myconf} --no-ri"
52 myconf="${myconf} --no-rdoc"
53 fi
54
55 ${RUBY} setup.rb $myconf --destdir="${D}" || die "setup.rb install failed"
56
57 doruby "${FILESDIR}/auto_gem.rb"
58 }
59
60 all_ruby_install() {
61 dodoc README || die "dodoc README failed"
62
63 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
64
65 if use server; then
66 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
67 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
68 fi
69 }
70
71 clear_source_cache() {
72 local gemsitedir=$(ruby_rbconfig_value 'sitelibdir' | sed -e 's:site_ruby:gems:')
73 SOURCE_CACHE="${gemsitedir}/source_cache"
74
75 if [[ -e "${SOURCE_CACHE}" ]]; then
76 rm "${SOURCE_CACHE}"
77 einfo "Cleared gem source cache."
78 fi
79 }
80
81 pkg_postinst() {
82 _ruby_each_implementation clear_source_cache
83
84 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
85 eselect ruby set $(eselect --brief --no-color ruby show | head -n1)
86 fi
87
88 ewarn
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