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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri May 13 17:49:31 2011 UTC (7 years, 11 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Update gentoo-defaults to install in /usr/local as root and in /home/graaff otherwise. Thanks to James Le Cuirot for the patch in bug 366153.

(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.7-r4.ebuild,v 1.6 2011/05/03 11:13:38 grobian Exp $
4
5 EAPI="3"
6
7 USE_RUBY="ruby18 ruby19 ree18 jruby"
8
9 inherit ruby-ng prefix
10
11 DESCRIPTION="Centralized Ruby extension management system"
12 HOMEPAGE="http://rubyforge.org/projects/rubygems/"
13 LICENSE="|| ( Ruby GPL-2 )"
14
15 SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
16
17 KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
18 SLOT="0"
19 IUSE="server test"
20
21 RDEPEND="
22 ruby_targets_jruby? ( >=dev-java/jruby-1.4.0-r5 )
23 ruby_targets_ruby19? ( >=dev-lang/ruby-1.9.2 )"
24
25 # index_gem_repository.rb
26 PDEPEND="server? ( dev-ruby/builder[ruby_targets_ruby18] )"
27
28 # Tests fail _badly_ when YARD is installed.. but just the
29 # rdoc-related stuff, so it's not a mistake.
30 ruby_add_bdepend "
31 test? (
32 dev-ruby/minitest
33 virtual/ruby-rdoc
34 !dev-ruby/yard
35 !dev-ruby/test-unit:2
36 )"
37
38 # Until all the JRuby tests' failures are sorted out
39 RESTRICT="ruby_targets_jruby? ( test )"
40
41 RUBY_PATCHES=(
42 "${FILESDIR}/${P}-gentoo.patch"
43 )
44
45 all_ruby_prepare() {
46 mkdir -p lib/rubygems/defaults || die
47 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
48
49 eprefixify lib/rubygems/defaults/operating_system.rb
50
51 # Disable broken tests when changing default values:
52 sed -i -e '/^ def test_self_bindir_default_dir/, /^ end/ s:^:#:' \
53 -e '/^ def test_self_default_dir/, /^ end/ s:^:#:' \
54 test/test_gem.rb || die
55 }
56
57 each_ruby_prepare() {
58 case "${RUBY}" in
59 *ruby19)
60 epatch "${FILESDIR}/${P}-ruby19.patch" || die
61 ;;
62 esac
63 }
64
65 each_ruby_compile() {
66 # Not really a build but...
67 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
68 }
69
70 each_ruby_test() {
71 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
72 unset RUBYOPT
73
74 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -Ilib:test \
75 -e 'Dir["./test/test_*.rb"].each { |tu| require tu }' || die "tests failed"
76 }
77
78 each_ruby_install() {
79 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
80 unset RUBYOPT
81
82 pushd lib &>/dev/null
83 doruby -r *
84 popd &>/dev/null
85
86 case "${RUBY}" in
87 *ruby19)
88 local sld=$(ruby_rbconfig_value 'sitelibdir')
89 insinto ${sld#${EPREFIX}} # bug #320813
90 newins "${FILESDIR}/auto_gem.rb.ruby19" auto_gem.rb || die
91 ;;
92 *)
93 doruby "${FILESDIR}/auto_gem.rb" || die
94 ;;
95 esac
96
97 newbin bin/gem $(basename ${RUBY} | sed -e 's:ruby:gem:') || die
98 }
99
100 all_ruby_install() {
101 dodoc README || die "dodoc README failed"
102
103 doenvd "${FILESDIR}/10rubygems" || die "doenvd 10rubygems failed"
104
105 if use server; then
106 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
107 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
108 fi
109 }
110
111 pkg_postinst() {
112 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
113 eselect ruby set $(eselect --brief --no-color ruby show | head -n1)
114 fi
115
116 ewarn
117 ewarn "To switch between available Ruby profiles, execute as root:"
118 ewarn "\teselect ruby set ruby(18|19|...)"
119 ewarn
120 }
121
122 pkg_postrm() {
123 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
124 ewarn "to run in current shells because of missing auto_gem."
125 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
126 ewarn "or start new shells"
127 ewarn
128 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
129 ewarn "RUBYOPT"
130 }

  ViewVC Help
Powered by ViewVC 1.1.20