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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Jul 2 10:04:52 2014 UTC (4 years, 9 months ago) by mrueg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Cleanup old. Update elog about eselect.

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

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-ruby/rubygems/rubygems-2.0.10.ebuild,v 1.1 2013/10/03 05:32:22 graaff Exp $
4
5 EAPI=5
6
7 USE_RUBY="ruby18 ruby19 ruby20 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="http://production.cf.rubygems.org/rubygems/${P}.tgz"
16
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~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 PDEPEND="server? ( >=dev-ruby/builder-2.1 )"
26
27 ruby_add_bdepend "
28 test? (
29 >=dev-ruby/minitest-4:0
30 virtual/ruby-rdoc
31 )"
32
33 all_ruby_prepare() {
34 mkdir -p lib/rubygems/defaults || die
35 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
36
37 eprefixify lib/rubygems/defaults/operating_system.rb
38
39 # Disable broken tests when changing default values:
40 sed -i -e '/^ def test_self_bindir_default_dir/, /^ end/ s:^:#:' \
41 -e '/^ def test_self_default_dir/, /^ end/ s:^:#:' \
42 test/rubygems/test_gem.rb || die
43 sed -i -e '/test_check_executable_overwrite_default_bin_dir/,/^ end/ s:^:#:' test/rubygems/test_gem_installer.rb || die
44
45 # Remove tests that want to write to /usr/local/bin
46 rm test/rubygems/test_gem_uninstaller.rb test/rubygems/test_gem_install_update_options.rb || die
47
48 # Remove a test that fails when yard is installed.
49 sed -i -e '/test_self_attribute_names/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
50
51 # Remove tests that try to load from an unsafe path
52 rm test/rubygems/test_gem.rb || die
53
54 # Remove tests that seem to have trouble loading from the /tmp test
55 # path. This should be narrowed down more...
56 rm test/rubygems/test_gem_commands_{cleanup_command,contents_command,pristine_command}.rb test/rubygems/test_gem_specification.rb || die
57 }
58
59 each_ruby_prepare() {
60 case ${RUBY} in
61 *ruby18)
62 # Remove test failing on ruby18. According to travis.yml
63 # upstream no longer cares.
64 sed -i -e '/test_install_location_extra_slash/,/^ end/ s:^:#:' test/rubygems/test_gem_package.rb || die
65 ;;
66 *jruby)
67 sed -i -e '/test_install_location_extra_slash/,/^ end/ s:^:#:' test/rubygems/test_gem_package.rb || die
68 # Remove failing tests. Before we did not run any tests at
69 # all so this is actually an improvement. Should be
70 rm test/rubygems/test_gem_security{,_policy}.rb test/rubygems/test_gem_{remote_fetcher,package_tar_reader_entry,package,installer,ext_ext_conf_builder}.rb || die
71 # investigated further.
72 esac
73 }
74
75 each_ruby_compile() {
76 # Not really a build but...
77 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
78 }
79
80 each_ruby_test() {
81 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
82 #unset RUBYOPT
83
84 if [[ "${EUID}" -ne "0" ]]; then
85 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -I.:lib:test \
86 -e 'Dir["test/**/test_*.rb"].each { |tu| require tu }' || die "tests failed"
87 else
88 ewarn "The userpriv feature must be enabled to run tests, bug 408951."
89 eerror "Testsuite will not be run."
90 fi
91 }
92
93 each_ruby_install() {
94 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
95 unset RUBYOPT
96 export RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}"
97
98 pushd lib &>/dev/null
99 doruby -r *
100 popd &>/dev/null
101
102 case "${RUBY}" in
103 *ruby19)
104 local sld=$(ruby_rbconfig_value 'sitelibdir')
105 insinto "${sld#${EPREFIX}}" # bug #320813
106 newins "${FILESDIR}/auto_gem.rb.ruby19" auto_gem.rb || die
107 ;;
108 *)
109 doruby "${FILESDIR}/auto_gem.rb" || die
110 ;;
111 esac
112
113 newbin bin/gem $(basename ${RUBY} | sed -e 's:ruby:gem:') || die
114 }
115
116 all_ruby_install() {
117 dodoc History.txt README.rdoc
118
119 doenvd "${FILESDIR}/10rubygems"
120
121 if use server; then
122 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
123 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
124 fi
125 }
126
127 pkg_postinst() {
128 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
129 eselect ruby set $(eselect --brief --no-color ruby show | head -n1)
130 fi
131
132 ewarn
133 ewarn "To switch between available Ruby profiles, execute as root:"
134 ewarn "\teselect ruby set ruby(18|19|...)"
135 ewarn
136 }
137
138 pkg_postrm() {
139 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
140 ewarn "to run in current shells because of missing auto_gem."
141 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
142 ewarn "or start new shells"
143 ewarn
144 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
145 ewarn "RUBYOPT"
146 }

  ViewVC Help
Powered by ViewVC 1.1.20