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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Jul 12 06:51:41 2015 UTC (3 years, 9 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
Fix color option for eselect on new installs to work with all eselect versions, fixing bug 554566.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x8883FA56A308A8D7!)

1 # Copyright 1999-2015 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.4.6.ebuild,v 1.2 2015/04/27 08:40:05 graaff Exp $
4
5 EAPI=5
6
7 USE_RUBY="ruby19 ruby20 ruby21 ruby22"
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 PDEPEND="server? ( >=dev-ruby/builder-2.1 )"
22
23 ruby_add_bdepend "
24 test? (
25 >=dev-ruby/minitest-4:0
26 dev-ruby/rdoc
27 )"
28
29 all_ruby_prepare() {
30
31 mkdir -p lib/rubygems/defaults || die
32 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
33
34 eprefixify lib/rubygems/defaults/operating_system.rb
35
36 # Disable broken tests when changing default values:
37 sed -i -e '/test_check_executable_overwrite_default_bin_dir/,/^ end/ s:^:#:' test/rubygems/test_gem_installer.rb || die
38 sed -i -e '/test_default_path/,/^ end/ s:^:#:' test/rubygems/test_gem.rb || die
39
40 # Remove a test that fails when yard is installed.
41 sed -i -e '/test_self_attribute_names/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
42
43 # Skip tests for default gems that all fail
44 sed -i -e '/test_default_gems_use_full_paths/,/^ end/ s:^:#:' test/rubygems/test_gem.rb || die
45 sed -i -e '/test_execute_ignore_default_gem_verbose/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_cleanup_command.rb || die
46 sed -i -e '/test_execute_default_gem/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_contents_command.rb test/rubygems/test_gem_commands_pristine_command.rb || die
47 sed -i -e '/test_execute_default_details/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_query_command.rb || die
48 sed -i -e '/test_execute_all/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_uninstall_command.rb || die
49 sed -i -e '/test_load_default_gem/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
50 sed -i -e '/test_uninstall_default_gem/,/^ end/ s:^:#:' test/rubygems/test_gem_uninstaller.rb || die
51 sed -i -e '/test_alien_default/,/^ end/ s:^:#:' test/rubygems/test_gem_validator.rb || die
52
53 # Avoid tests playing tricks with ruby engine that don't seem to
54 # work for us.
55 rm test/rubygems/test_gem_request_set_gem_dependency_api.rb || die
56
57 # Avoid test requiring network access
58 sed -i -e '/test_download_to_cache/askip "requires network access"' test/rubygems/test_gem_remote_fetcher.rb || die
59 }
60
61 each_ruby_compile() {
62 # Not really a build but...
63 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
64 }
65
66 each_ruby_test() {
67 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
68 #unset RUBYOPT
69
70 if [[ "${EUID}" -ne "0" ]]; then
71 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -I.:lib:test \
72 -e 'Dir["test/**/test_*.rb"].each { |tu| require tu }' || die "tests failed"
73 else
74 ewarn "The userpriv feature must be enabled to run tests, bug 408951."
75 eerror "Testsuite will not be run."
76 fi
77 }
78
79 each_ruby_install() {
80 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
81 unset RUBYOPT
82 export RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}"
83
84 pushd lib &>/dev/null
85 doruby -r *
86 popd &>/dev/null
87
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 newbin bin/gem $(basename ${RUBY} | sed -e 's:ruby:gem:') || die
93 }
94
95 all_ruby_install() {
96 dodoc History.txt README.rdoc
97
98 if use server; then
99 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
100 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
101 fi
102 }
103
104 pkg_postinst() {
105 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
106 eselect ruby set $(eselect --brief --colour=no ruby show | head -n1)
107 fi
108
109 ewarn
110 ewarn "To switch between available Ruby profiles, execute as root:"
111 ewarn "\teselect ruby set ruby(20|21|...)"
112 ewarn
113 }

  ViewVC Help
Powered by ViewVC 1.1.20