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

Contents of /dev-ruby/rubygems/rubygems-2.0.14-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sun Dec 14 10:02:31 2014 UTC (4 years, 4 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Cleanup.

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

1 # Copyright 1999-2014 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.14-r1.ebuild,v 1.6 2014/11/26 02:20:44 mrueg Exp $
4
5 EAPI=5
6
7 USE_RUBY="ruby19 ruby20 ruby21"
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="ruby_targets_ruby19? ( >=dev-lang/ruby-1.9.3_rc1 )"
22
23 PDEPEND="server? ( >=dev-ruby/builder-2.1 )"
24
25 ruby_add_bdepend "
26 test? (
27 >=dev-ruby/minitest-4:0
28 virtual/ruby-rdoc
29 )"
30
31 all_ruby_prepare() {
32 mkdir -p lib/rubygems/defaults || die
33 cp "${FILESDIR}/gentoo-defaults.rb" lib/rubygems/defaults/operating_system.rb || die
34
35 eprefixify lib/rubygems/defaults/operating_system.rb
36
37 # Disable broken tests when changing default values:
38 sed -i -e '/^ def test_self_bindir_default_dir/, /^ end/ s:^:#:' \
39 -e '/^ def test_self_default_dir/, /^ end/ s:^:#:' \
40 test/rubygems/test_gem.rb || die
41 sed -i -e '/test_check_executable_overwrite_default_bin_dir/,/^ end/ s:^:#:' test/rubygems/test_gem_installer.rb || die
42
43 # Remove tests that want to write to /usr/local/bin
44 rm test/rubygems/test_gem_uninstaller.rb test/rubygems/test_gem_install_update_options.rb || die
45
46 # Remove a test that fails when yard is installed.
47 sed -i -e '/test_self_attribute_names/,/^ end/ s:^:#:' test/rubygems/test_gem_specification.rb || die
48
49 # Remove tests that try to load from an unsafe path
50 rm test/rubygems/test_gem.rb || die
51
52 # Remove tests that seem to have trouble loading from the /tmp test
53 # path. This should be narrowed down more...
54 rm test/rubygems/test_gem_commands_{cleanup_command,contents_command,pristine_command}.rb test/rubygems/test_gem_specification.rb || die
55 }
56
57 each_ruby_compile() {
58 # Not really a build but...
59 sed -i -e 's:#!.*:#!'"${RUBY}"':' bin/gem
60 }
61
62 each_ruby_test() {
63 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
64 #unset RUBYOPT
65
66 if [[ "${EUID}" -ne "0" ]]; then
67 RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}" ${RUBY} -I.:lib:test \
68 -e 'Dir["test/**/test_*.rb"].each { |tu| require tu }' || die "tests failed"
69 else
70 ewarn "The userpriv feature must be enabled to run tests, bug 408951."
71 eerror "Testsuite will not be run."
72 fi
73 }
74
75 each_ruby_install() {
76 # Unset RUBYOPT to avoid interferences, bug #158455 et. al.
77 unset RUBYOPT
78 export RUBYLIB="$(pwd)/lib${RUBYLIB+:${RUBYLIB}}"
79
80 pushd lib &>/dev/null
81 doruby -r *
82 popd &>/dev/null
83
84 case "${RUBY}" in
85 *ruby19)
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 *)
91 doruby "${FILESDIR}/auto_gem.rb" || die
92 ;;
93 esac
94
95 newbin bin/gem $(basename ${RUBY} | sed -e 's:ruby:gem:') || die
96 }
97
98 all_ruby_install() {
99 dodoc History.txt README.rdoc
100
101 doenvd "${FILESDIR}/10rubygems"
102
103 if use server; then
104 newinitd "${FILESDIR}/init.d-gem_server2" gem_server || die "newinitd failed"
105 newconfd "${FILESDIR}/conf.d-gem_server" gem_server || die "newconfd failed"
106 fi
107 }
108
109 pkg_postinst() {
110 if [[ ! -n $(readlink "${ROOT}"usr/bin/gem) ]] ; then
111 eselect ruby set $(eselect --brief ruby show | head -n1)
112 fi
113
114 ewarn
115 ewarn "To switch between available Ruby profiles, execute as root:"
116 ewarn "\teselect ruby set ruby(19|20|...)"
117 ewarn
118 }
119
120 pkg_postrm() {
121 ewarn "If you have uninstalled dev-ruby/rubygems, Ruby applications are unlikely"
122 ewarn "to run in current shells because of missing auto_gem."
123 ewarn "Please run \"unset RUBYOPT\" in your shells before using ruby"
124 ewarn "or start new shells"
125 ewarn
126 ewarn "If you have not uninstalled dev-ruby/rubygems, please do not unset "
127 ewarn "RUBYOPT"
128 }

  ViewVC Help
Powered by ViewVC 1.1.20