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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu May 10 08:09:58 2012 UTC (6 years, 11 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump with fixes for the recent security fixes. Remove broken version.

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 # Copyright 1999-2012 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.8.23.ebuild,v 1.2 2012/04/22 09:28:07 graaff Exp $
4
5 EAPI="4"
6
7 USE_RUBY="ruby18 ree18 ruby19 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 MIT )"
14
15 SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
16
17 KEYWORDS="~alpha ~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.5.6-r1 )
23 ruby_targets_ruby19? ( >=dev-lang/ruby-1.9.3_rc1 )"
24
25 # index_gem_repository.rb
26 PDEPEND="server? ( dev-ruby/builder[ruby_targets_ruby18] )"
27
28 # Tests fail when YARD is installed.. but just the rdoc-related stuff,
29 # 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 )"
36
37 all_ruby_prepare() {
38 mkdir -p lib/rubygems/defaults || die
39 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
40
41 eprefixify lib/rubygems/defaults/operating_system.rb
42
43 # Disable broken tests when changing default values:
44 sed -i -e '/^ def test_self_bindir_default_dir/, /^ end/ s:^:#:' \
45 -e '/^ def test_self_default_dir/, /^ end/ s:^:#:' \
46 test/rubygems/test_gem.rb || die
47
48 # Remove tests that want to write to /usr/local/bin
49 rm test/rubygems/test_gem_uninstaller.rb test/rubygems/test_gem_install_update_options.rb || die
50 }
51
52 each_ruby_compile() {
53 # Not really a build but...
54 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
55 }
56
57 each_ruby_test() {
58 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
59 unset RUBYOPT
60
61 if [[ "${EUID}" -ne "0" ]]; then
62 case ${RUBY} in
63 *jruby)
64 eqawarn "Skipping tests for jruby 1.5."
65 ;;
66 *)
67 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -I.:lib:test \
68 -e 'Dir["test/**/test_*.rb"].each { |tu| require tu }' || die "tests failed"
69 ;;
70 esac
71 else
72 ewarn "The userpriv feature must be enabled to run tests, bug 408951."
73 eerror "Testsuite will not be run."
74 fi
75 }
76
77 each_ruby_install() {
78 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
79 unset RUBYOPT
80 export RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}"
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 History.txt README.rdoc
102
103 doenvd "${FILESDIR}/10rubygems"
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