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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Apr 22 08:53:36 2012 UTC (6 years, 11 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove old versions.

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

  ViewVC Help
Powered by ViewVC 1.1.20