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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20