summaryrefslogtreecommitdiff
path: root/java/apache-ant/PKGBUILD
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 17:09:23 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 17:09:23 -0400
commitf02e29ff7501aa7b5e074c60718c61ff10e6622d (patch)
tree832c2a79aa9f2403e766b8824332913cdc576ea3 /java/apache-ant/PKGBUILD
parent55ce2f9ba6fa030cea9008f93f5fc715ee027615 (diff)
mv libre/apache-ant java/apache-ant
Diffstat (limited to 'java/apache-ant/PKGBUILD')
-rwxr-xr-xjava/apache-ant/PKGBUILD110
1 files changed, 110 insertions, 0 deletions
diff --git a/java/apache-ant/PKGBUILD b/java/apache-ant/PKGBUILD
new file mode 100755
index 000000000..77e0dfe94
--- /dev/null
+++ b/java/apache-ant/PKGBUILD
@@ -0,0 +1,110 @@
+# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
+# Maintainer (Arch): Paul Mattal <paul@archlinux.org>
+# Contributor: Andrew Wright <andreww@photism.org>
+
+pkgname=apache-ant
+pkgver=1.8.4
+
+provides=("apache-ant-libre=$pkgver")
+replaces=("apache-ant-libre")
+conflicts=("apache-ant-libre")
+
+pkgrel=1.1
+pkgdesc="A Java-based build tool"
+arch=('any')
+license=('Apache')
+url="http://ant.apache.org/"
+_mirror=http://archive.apache.org/dist
+source=($_mirror/ant/source/${pkgname}-${pkgver}-src.tar.bz2
+ ${pkgname}.sh ${pkgname}.csh)
+depends=('java-environment')
+
+# This list is adapted from https://ant.apache.org/manual/install.html#librarydependencies
+declare -A _opts
+_opts[junit]='to have JUnit on the classpath in javac tasks;/usr/share/java/junit.jar'
+_opts[xalan-java]='<junitreport> task;/usr/share/java/xalan.jar'
+_opts[antlr2]='<antlr> task;/usr/share/java/antlr2.jar::antlr.jar'
+#_opts[java-bsf]='<script> task;/usr/share/java/bsf.jar'
+#_opts[groovy]='Groovy with <script> and <scriptdef> tasks;/usr/share/java/groovy.jar'
+_opts[java-asm2]='Groovy with <script> and <scriptdef> tasks;/usr/share/java/asm-2.jar::asm.jar /usr/share/java/asm-util-2.jar::asm-util.jar'
+#_opts[netrexx]='<netrexx> task, Rexx with <script> task;/usr/share/java/netrexx.jar'
+_opts[rhino]='Javascript with <script> task;/usr/share/java/js.jar'
+_opts[jython]='Python with <script> task;/opt/jython/jython.jar'
+#_opts[jacl]='TCL with <script> task;/usr/share/java/jacl.jar'
+#_opts[tcljava]='TCL with <script> task;/usr/share/java/tcljava.jar'
+_opts[beanshell>=1.3]='BeanShell with <script> task;/usr/share/java/bsh.jar::beanshell.jar'
+#_opts[jruby]='Ruby with <script> task;/usr/share/java/jruby.jar'
+#_opts[judo]='Judoscript with <script> task;/usr/share/java/judo.jar'
+_opts[java-commons-logging]='CommonsLoggingListener;/usr/share/java/commons-logging/commons-logging.jar'
+#_opts[java-log4j]='Log4jListener;/usr/share/java/log4j.jar'
+#_opts[java-commons-net>=1.4.0]='<ftp>, <rexec> and <telnet> tasks;/usr/share/java/commons-net.jar'
+#_opts[java-bcel]="'classfileset' data type, JavaClassHelper for ClassConstants filter reader;/usr/share/java/bcel.jar"
+#_opts[java-mail]='<mimemail> task, mime encoding with <mail>;/usr/share/java/mail.jar'
+#_opts[java-activation]='<mimemail> task, mime encoding with <mail>;/usr/share/java/activation.jar'
+#_opts[jdepend]='<jdepend> task;/usr/share/java/jdepend.jar'
+#_opts[java-xmlcommons-resolver>=1.1beta]="external files for 'xmlcatalog' datatype;/usr/share/java/resolver.jar"
+#_opts[java-jsch>=0.1.42]='<sshexec> and <scp> tasks;/usr/share/java/jsch.jar'
+#_opts[java-advanced-imaging]='<image> task/usr/share/java/jai/*.jar'
+
+for pkg in "${!_opts[@]}"; do
+ optdepends+=("$pkg: ${_opts[$pkg]%;*}")
+ makedepends+=("$pkg")
+done
+
+build() {
+ # This directory is what becomes
+ # http://archive.apache.org/dist/ant/binaries/${pkgname}-${pkgver}-bin.tar.bz2
+ # which is what Arch uses
+ rm -rf "${srcdir}"/${pkgname}-${pkgver}-bin
+ mkdir -p "${srcdir}"/${pkgname}-${pkgver}-bin
+
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ # Symlink to external optional libraries
+ for jar in ${_opts[@]#*;}; do
+ ln -sf ${jar%::*} lib/optional/`basename ${jar/*::}`
+ done
+ # Build
+ source "/etc/profile.d/jdk.sh" # Get the JAVA_HOME env var
+ sh build.sh -Ddist.dir="${srcdir}"/${pkgname}-${pkgver}-bin dist
+}
+
+package() {
+ cd "${srcdir}"/${pkgname}-${pkgver}-bin
+ source "${srcdir}"/${pkgname}.sh # Get the ANT_HOME env var
+ source "/etc/profile.d/jdk.sh" # Get the JAVA_HOME env var
+
+ ## Install profile.d script
+ install -d "${pkgdir}"/etc/profile.d
+ install -m755 "${srcdir}"/${pkgname}.{csh,sh} "${pkgdir}"/etc/profile.d/
+
+ ## Install the main distribution
+ install -d "${pkgdir}"/${ANT_HOME}
+ cp -Rp * "${pkgdir}"/${ANT_HOME}
+
+ ## Fix the distribution
+ # Remove Windows .bat/.cmd files
+ rm -f "${pkgdir}"/${ANT_HOME}/bin/*.{bat,cmd}
+ # Fix python2 path
+ sed -i 's|/usr/bin/python|/usr/bin/python2|' "${pkgdir}"/${ANT_HOME}/bin/runant.py
+ # Symlink to external optional libraries
+ for jar in ${_opts[@]#*;}; do
+ ln -sf ${jar%::*} "${pkgdir}"/${ANT_HOME}/lib/`basename ${jar/*::}`
+ done
+
+ ## Symlink the /opt distribution to the normal places
+ install -d "${pkgdir}"/usr/bin
+ install -d "${pkgdir}"/usr/share/doc/${pkgname}
+ install -d "${pkgdir}"/usr/share/licenses/${pkgname}
+
+ cd "${pkgdir}"/${ANT_HOME}
+ for prog in bin/*; do
+ ln -sf ${ANT_HOME}/$prog "${pkgdir}"/usr/bin
+ done
+ ln -sf ${ANT_HOME}/{README,WHATSNEW} "${pkgdir}"/usr/share/doc/${pkgname}
+ ln -sf ${ANT_HOME}/docs "${pkgdir}"/usr/share/doc/${pkgname}/html
+ ln -sf ${ANT_HOME}/{LICENSE,NOTICE} "${pkgdir}"/usr/share/licenses/${pkgname}
+}
+
+md5sums=('c474fa9d0c35a24037c23b6e476862c1'
+ 'bd63c881be406f515fc4d22635e8326a'
+ 'aaa615512cbe1ed7f3b62c1ff46802f8')