Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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