/[gentoo-x86]/dev-java/jruby/jruby-1.0.0.ebuild
Gentoo

Contents of /dev-java/jruby/jruby-1.0.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sat Jan 23 13:51:00 2010 UTC (4 years, 8 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Remove older versions, only leave around those supporting ruby-ng-installed packages.
(Portage version: 2.2_rc61/cvs/Linux x86_64)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.0.0.ebuild,v 1.4 2007/12/17 13:58:17 caleb Exp $
4
5 JAVA_PKG_IUSE="doc source test"
6 inherit eutils java-pkg-2 java-ant-2
7
8 # 1.0 < 1.0.0_rcX
9 # so, we'll pretend 1.0 is actually 1.0.0
10 # remove this for next release
11 # TODO complain to upstream
12 MY_PV="1.0"
13 MY_P="${PN}-${MY_PV}"
14
15 DESCRIPTION="Java based ruby interpreter implementation"
16 HOMEPAGE="http://jruby.codehaus.org/"
17 SRC_URI="http://dist.codehaus.org/${PN}/${PN}-src-${MY_PV}.tar.gz"
18
19 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
20 SLOT="0"
21 KEYWORDS="~amd64 ~ppc ~x86"
22 IUSE="bsf"
23
24 COMMON_DEPEND=">=dev-java/jline-0.9.91
25 =dev-java/asm-2.2*
26 dev-java/backport-util-concurrent"
27 RDEPEND=">=virtual/jre-1.4
28 ${COMMON_DEPEND}"
29
30 DEPEND=">=virtual/jdk-1.4
31 bsf? ( >=dev-java/bsf-2.3 )
32 test? (
33 =dev-java/junit-3*
34 dev-java/ant-junit
35 dev-java/ant-trax
36 )
37 ${COMMON_DEPEND}"
38 PDEPEND="dev-ruby/rubygems
39 >=dev-ruby/rake-0.7.3
40 >=dev-ruby/rspec-1.0.4"
41
42 S="${WORKDIR}/${MY_P}"
43
44 RUBY_HOME=/usr/share/${PN}/lib/ruby
45 SITE_RUBY=${RUBY_HOME}/site_ruby
46 GEMS=${RUBY_HOME}/gems
47
48 pkg_setup() {
49 java-pkg-2_pkg_setup
50
51 if [[ -d ${SITE_RUBY} && ! -L ${SITE_RUBY} ]]; then
52 ewarn "dev-java/jruby now uses dev-lang/ruby's site_ruby directory by creating symlinks."
53 ewarn "${SITE_RUBY} is a directory right now, which will cause problems when being merged onto the filesystem."
54 fi
55 if [[ -d ${GEMS} && ! -L ${GEMS} ]]; then
56 ewarn "dev-java/jruby now uses dev-lang/ruby's gems directory by creating symlinks."
57 ewarn "${GEMS} is a directory right now, which will cause problems when being merged onto the filesystem."
58 fi
59
60 # only use javac, see http://jira.codehaus.org/browse/JRUBY-675
61 java-pkg_force-compiler javac
62 }
63
64 src_unpack() {
65 unpack ${A}
66 cd "${S}"
67 # prevents /root/.jruby being created at build time with
68 # FEATURES="-userpriv"
69 # see http://bugs.gentoo.org/show_bug.cgi?id=170058
70 epatch "${FILESDIR}"/${PN}-0.9.8-sandbox.patch
71 # search only lib, kills jdk1.4+ property which we set manually
72 java-ant_ignore-system-classes
73
74 cd "${S}"/lib
75 rm -v *.jar || die
76
77 java-pkg_jar-from --build-only ant-core ant.jar
78 java-pkg_jar-from asm-2.2 asm.jar
79 java-pkg_jar-from asm-2.2 asm-commons.jar
80 java-pkg_jar-from jline
81 java-pkg_jar-from backport-util-concurrent
82 use test && java-pkg_jar-from --build-only junit
83
84 # build-only because it's just BSF adapter classes and won't be used
85 # unless invoked from bsf itself, so no need to pollute classpath
86 if use bsf; then
87 java-pkg_jar-from --build-only bsf-2.3
88 else
89 cd "${S}"
90 # testcases depending on bsf
91 rm test/org/jruby/test/TestAdoptedThreading.java || die
92 rm test/org/jruby/javasupport/test/TestBSF.java || die
93 sed -i -e '/TestBSF.class/d' \
94 test/org/jruby/javasupport/test/JavaSupportTestSuite.java || die
95 sed -i -e '/TestAdoptedThreading.class/d' \
96 test/org/jruby/test/MainTestSuite.java || die
97 fi
98 }
99
100 src_compile() {
101 eant jar $(use_doc create-apidocs) -Djruby.home="${T}"/.jruby -Djdk1.4+=true
102 }
103
104 src_test() {
105 # needs bsf's runtime deps to work
106 use bsf && java-pkg_jar-from --into lib --with-dependencies bsf-2.3
107 ANT_TASKS="ant-junit ant-trax" eant test -Djdk1.4+=true
108 }
109
110 src_install() {
111 java-pkg_dojar lib/${PN}.jar
112
113 dodoc README docs/{*.txt,README.*,BeanScriptingFramework} || die
114 dohtml docs/getting_involved.html || die
115
116 if use doc; then
117 java-pkg_dojavadoc docs/api
118 fi
119 use source && java-pkg_dosrc src/org
120 java-pkg_dolauncher ${PN} \
121 --main 'org.jruby.Main' \
122 --java_args '-Djruby.base=/usr/share/jruby -Djruby.home=/usr/share/jruby -Djruby.lib=/usr/share/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh'
123 dobin "${S}"/bin/jirb
124
125 dodir "/usr/share/${PN}/lib"
126 insinto "/usr/share/${PN}/lib"
127 doins -r "${S}/lib/ruby"
128
129 # Share gems with regular ruby
130 rm -r "${D}"/usr/share/${PN}/lib/ruby/gems || die
131 dosym /usr/lib/ruby/gems /usr/share/${PN}/lib/ruby/gems || die
132
133 # Share site_ruby with regular ruby
134 rm -r "${D}"/usr/share/${PN}/lib/ruby/site_ruby || die
135 dosym /usr/lib/ruby/site_ruby /usr/share/${PN}/lib/ruby/site_ruby || die
136 }
137
138 pkg_preinst() {
139 local bad_directory=0
140
141 if [[ -d ${SITE_RUBY} && ! -L ${SITE_RUBY} ]]; then
142 eerror "${SITE_RUBY} is a directory. Please move this directory out of the way, and then emerge --resume."
143 bad_directory=1
144 fi
145
146 if [[ -d ${GEMS} && ! -L ${GEMS} ]]; then
147 eerror "${GEMS} is a directory. Please move this directory out of the way, and then emerge --resume."
148 bad_directory=1
149 fi
150
151 if [[ ! ${bad_directory} ]]; then
152 die "Please address the above errors, then emerge --resume."
153 fi
154 }

  ViewVC Help
Powered by ViewVC 1.1.20