Contents of /trunk/extras/apache-ant/apache-ant-1.9.7-r1.smage2
Parent Directory | Revision Log
Revision 28033 -
(show annotations)
(download)
Wed May 11 12:51:50 2016 UTC (8 years, 1 month ago) by niro
File size: 3674 byte(s)
Wed May 11 12:51:50 2016 UTC (8 years, 1 month ago) by niro
File size: 3674 byte(s)
-disabled atm
1 | # $Id$ |
2 | |
3 | PNAME="apache-ant" |
4 | PVER="1.9.7" |
5 | PBUILD="r1" |
6 | |
7 | STATE="disabled" |
8 | PCAT="dev-java" |
9 | |
10 | DESCRIPTION="Ant is a java-based build tool." |
11 | HOMEPAGE="http://ant.apache.org/" |
12 | |
13 | # enable bootstrap of ant or not (0=disabled, 1=enabled) |
14 | BOOTSTRAP=0 |
15 | |
16 | DEPEND=">= virtual/java-jdk |
17 | >= dev-java/junit-4.12 |
18 | >= dev-java/hamcrest-1.3" |
19 | |
20 | if [[ ${BOOTSTRAP} = 0 ]] |
21 | then |
22 | SDEPEND=">= dev-java/apache-ant-1.9" |
23 | fi |
24 | |
25 | SRCFILE="${PNAME}-${PVER}-src.tar.bz2" |
26 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
27 | |
28 | OPT_SRCFILE="optional-20160503-1.tar.bz2" |
29 | |
30 | sminclude mbuild java |
31 | msetfeature "!check" |
32 | |
33 | SRC_URI=( |
34 | http://www.apache.org/dist/ant/source/${SRCFILE} |
35 | mirror://${PNAME}/${SRCFILE} |
36 | mirror://${PNAME}/${OPT_SRCFILE} |
37 | ) |
38 | |
39 | UP2DATE="updatecmd http://www.apache.org/dist/ant/source/ | grep ${PNAME}- | sed 's:-src::g' | highesttarball" |
40 | |
41 | src_prepare() |
42 | { |
43 | munpack ${SRCFILE} || die |
44 | munpack ${OPT_SRCFILE} ${SRCDIR}/lib/optional || die |
45 | } |
46 | |
47 | src_compile() |
48 | { |
49 | local myopts |
50 | local targets |
51 | local junit |
52 | local hamcrest |
53 | local ant_exec |
54 | cd ${SRCDIR} |
55 | |
56 | # get junit from classpath |
57 | if [[ -L ${JAVA_CLASSPATH_DIR}/junit.jar ]] |
58 | then |
59 | junit="${JAVA_CLASSPATH_DIR}/$(readlink ${JAVA_CLASSPATH_DIR}/junit.jar)" |
60 | else |
61 | junit="${JAVA_CLASSPATH_DIR}/junit.jar" |
62 | fi |
63 | # and linking it to lib/optional as apache-ant has now a hard-dependency to it |
64 | echo "Using junit.jar from ${junit}!" |
65 | #rm -v ${SRCDIR}/lib/optional/junit.jar || die |
66 | #ln -snf ${junit} ${SRCDIR}/lib/optional/junit.jar || die |
67 | rm -v ${SRCDIR}/lib/optional/junit-4.11.jar || die |
68 | ln -vsnf ${junit} ${SRCDIR}/lib/optional/junit-4.11.jar || die |
69 | |
70 | # get hamcrest-core from classpath |
71 | if [[ -L ${JAVA_CLASSPATH_DIR}/hamcrest-core.jar ]] |
72 | then |
73 | hamcrest="${JAVA_CLASSPATH_DIR}/$(readlink ${JAVA_CLASSPATH_DIR}/hamcrest-core.jar)" |
74 | else |
75 | hamcrest="${JAVA_CLASSPATH_DIR}/hamcrest-core.jar" |
76 | fi |
77 | # and linking it to lib/optional as apache-ant has now a hard-dependency to it |
78 | echo "Using hamcrest-core.jar from ${hamcrest}!" |
79 | rm -v ${SRCDIR}/lib/optional/hamcrest-core-1.3.jar || die |
80 | ln -vsnf ${hamcrest} ${SRCDIR}/lib/optional/hamcrest-core-1.3.jar || die |
81 | |
82 | case ${BOOTSTRAP} in |
83 | 0) ant_exec="ant" ;; |
84 | 1) ant_exec='./build.sh' ;; |
85 | *) die "unknown bootstrap option '${BOOTSTRAP}'" ;; |
86 | esac |
87 | |
88 | # we use a tarball which provides all optionals to honor proxies |
89 | # |
90 | # # ant needs HOME to download libs to $HOME/.m2/repository |
91 | # # this one does not honor authenticated proxies |
92 | # export ANT_OPTS="-Duser.home=${SRCDIR}" |
93 | # ${ant_exec} -Ddest=optional -f fetch.xml || die |
94 | |
95 | # enable verbose mode |
96 | myopts+=" -verbose" |
97 | |
98 | # all build targets all together (disabled by default, don't want javadocs) |
99 | #targets+=" dist" |
100 | |
101 | # only build the jars |
102 | targets+=" jars test-jar" |
103 | |
104 | # enable build of javadocs (disabled by default to save lots of ram @buildtime) |
105 | #targets+=" javadocs" |
106 | # don't fail the build on javadocs erros |
107 | #myopts+=" -Djavadoc.failonerror=false" |
108 | |
109 | ${ant_exec} ${myopts} ${targets} || die |
110 | } |
111 | |
112 | src_install() |
113 | { |
114 | cd ${SRCDIR} |
115 | |
116 | # this one sucks, ignores libdir and installs unneccessary stuff |
117 | #ANT_HOME=${BINDIR}/usr ./build.sh install-lite || die |
118 | |
119 | # needed directories |
120 | minstalldir /usr/bin || die |
121 | minstalldir /usr/share/${PNAME}-${PVER}/bin || die |
122 | |
123 | # binaries |
124 | local i |
125 | for i in ant antRun runant.pl runant.py complete-ant-cmd.pl |
126 | do |
127 | minstallexec src/script/${i} /usr/share/${PNAME}-${PVER}/bin || die ${i} |
128 | mlink /usr/share/${PNAME}-${PVER}/bin/${i} /usr/bin/${i} || die |
129 | done |
130 | |
131 | # jars and classpathes env |
132 | mclasspathinit || die |
133 | minstalljar-classpath $(find build/lib -name \*.jar) || die |
134 | |
135 | # add ANT_HOME too |
136 | MCONFIG="/etc/env.d/22java-app-${PNAME}" |
137 | maddconfig "ANT_HOME=\"/usr/share/${PNAME}-${PVER}\"" || die |
138 | |
139 | minstalldocs README LICENSE NOTICE WHATSNEW || die |
140 | } |