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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (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.13: +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.2.2.ebuild,v 1.13 2015/01/19 19:56:14 graaff Exp $
4
5 EAPI=5
6
7 USE_RUBY="ruby19 ruby20"
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 mkdir -p lib/rubygems/defaults || die
31 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
32
33 eprefixify lib/rubygems/defaults/operating_system.rb
34
35 # Disable broken tests when changing default values:
36 sed -i -e '/test_check_executable_overwrite_default_bin_dir/,/^ end/ s:^:#:' test/rubygems/test_gem_installer.rb || die
37
38 # Remove a test that fails when yard is installed.
39 sed -i -e '/test_self_attribute_names/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
40
41 # Skip tests for default gems that all fail
42 sed -i -e '/test_default_gems_use_full_paths/,/^ end/ s:^:#:' test/rubygems/test_gem.rb || die
43 sed -i -e '/test_execute_ignore_default_gem_verbose/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_cleanup_command.rb || die
44 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
45 sed -i -e '/test_execute_default_details/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_query_command.rb || die
46 sed -i -e '/test_execute_all/,/^ end/ s:^:#:' test/rubygems/test_gem_commands_uninstall_command.rb || die
47 sed -i -e '/test_load_default_gem/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
48 sed -i -e '/test_uninstall_default_gem/,/^ end/ s:^:#:' test/rubygems/test_gem_uninstaller.rb || die
49 sed -i -e '/test_alien_default/,/^ end/ s:^:#:' test/rubygems/test_gem_validator.rb || die
50
51 # Avoid tests playing tricks with ruby engine that don't seem to
52 # work for us.
53 rm test/rubygems/test_gem_request_set_gem_dependency_api.rb || die
54
55 # Avoid test requiring network access
56 sed -i -e '/test_download_to_cache/askip "requires network access"' test/rubygems/test_gem_remote_fetcher.rb || die
57 }
58
59 each_ruby_compile() {
60 # Not really a build but...
61 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
62 }
63
64 each_ruby_test() {
65 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
66 #unset RUBYOPT
67
68 if [[ "${EUID}" -ne "0" ]]; then
69 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -I.:lib:test \
70 -e 'Dir["test/**/test_*.rb"].each { |tu| require tu }' || die "tests failed"
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 local sld=$(ruby_rbconfig_value 'sitelibdir')
87 insinto "${sld#${EPREFIX}}" # bug #320813
88 newins "${FILESDIR}/auto_gem.rb.ruby19" auto_gem.rb || die
89
90 newbin bin/gem $(basename ${RUBY} | sed -e 's:ruby:gem:') || die
91 }
92
93 all_ruby_install() {
94 dodoc History.txt README.rdoc
95
96 if use server; then
97 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
98 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
99 fi
100 }
101
102 pkg_postinst() {
103 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
104 eselect ruby set $(eselect --brief --colour=no ruby show | head -n1)
105 fi
106
107 ewarn
108 ewarn "To switch between available Ruby profiles, execute as root:"
109 ewarn "\teselect ruby set ruby(19|20|...)"
110 ewarn
111 }
112
113 pkg_postrm() {
114 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
115 ewarn "to run in current shells because of missing auto_gem."
116 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
117 ewarn "or start new shells"
118 ewarn
119 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
120 ewarn "RUBYOPT"
121 }

  ViewVC Help
Powered by ViewVC 1.1.20