/[gentoo-x86]/dev-java/stringtemplate/stringtemplate-3.2.1.ebuild
Gentoo

Contents of /dev-java/stringtemplate/stringtemplate-3.2.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Mar 15 20:00:07 2011 UTC (3 years, 4 months ago) by serkan
Branch: MAIN
Version bump to fix bug #358943. Thanks to Oliver Nautsch <oliver.nautsch@gmail.com> for the ebuild.

(Portage version: 2.2.0_alpha26/cvs/Linux x86_64)

1 serkan 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/dev-java/stringtemplate/stringtemplate-3.2.ebuild,v 1.9 2010/01/15 20:38:50 abcd Exp $
4    
5     EAPI="2"
6     JAVA_PKG_IUSE="doc source test"
7    
8     inherit eutils java-pkg-2 java-ant-2
9    
10     MY_PV="${PV/_beta/b}"
11     S_PV="${PV/_beta/.b}"
12     MY_P="${PN}-${MY_PV}"
13    
14     DESCRIPTION="A Java template engine"
15     HOMEPAGE="http://www.stringtemplate.org/"
16     SRC_URI="http://www.stringtemplate.org/download/${MY_P}.tar.gz"
17     LICENSE="BSD"
18     SLOT="0"
19     KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
20     IUSE=""
21    
22     COMMON_DEPEND=">=dev-java/antlr-2.7.7:0[java]"
23    
24     RDEPEND=">=virtual/jre-1.5
25     ${COMMON_DEPEND}"
26    
27     DEPEND=">=virtual/jdk-1.5
28     test? ( dev-java/junit:4 )
29     ${COMMON_DEPEND}"
30    
31     S="${WORKDIR}/${PN}-${S_PV}"
32    
33     java_prepare() {
34     find . -name "*.class" -print -delete || die "Failed deleting precompiled classes"
35     find . -name "*.jar" -print -delete || die "Failed deleting prebuilt classes"
36     }
37    
38     antlr2() {
39     java -cp $(java-pkg_getjars antlr) antlr.Tool "${@}" || die "antlr2 failed"
40     }
41    
42     src_compile() {
43     einfo "Generate from grammars"
44     cd src/org/antlr/stringtemplate/language || die
45     # order same as in pom.xml
46     antlr2 template.g
47     antlr2 angle.bracket.template.g
48     antlr2 action.g
49     antlr2 eval.g
50     antlr2 group.g
51     antlr2 interface.g
52    
53     cd "${S}" || die
54     find src -name "*.java" >> "${T}/sources" || die
55     ejavac -d target/classes -cp $(java-pkg_getjars antlr) "@${T}/sources"
56    
57     # create javadoc
58     if use doc; then
59     javadoc -classpath $(java-pkg_getjars antlr) -d javadoc "@${T}/sources" || die "Javadoc failed"
60     fi
61    
62     # jar things up
63     cd target/classes || die
64     find -type f >> "${T}/classes" || die
65     jar cf ${PN}.jar "@${T}/classes" || die "jar failed"
66     }
67    
68     src_install() {
69     java-pkg_dojar target/classes/${PN}.jar
70     dodoc README.txt CHANGES.txt || die
71     use source && java-pkg_dosrc src/*
72     use doc && java-pkg_dojavadoc javadoc
73     }
74    
75     src_test() {
76     find test -name "*.java" >> "${T}/test-sources" || die
77     ejavac -cp target/classes:$(java-pkg_getjars antlr,junit-4) -d target/test-classes "@${T}/test-sources"
78     ejunit4 -cp target/classes:target/test-classes org.antlr.stringtemplate.test.TestStringTemplate
79     }

  ViewVC Help
Powered by ViewVC 1.1.20