Magellan Linux

Contents of /trunk/extras/apache-ant/apache-ant-1.10.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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