summaryrefslogtreecommitdiffstats
path: root/abs/extra/apache-ant/PKGBUILD
blob: d8982e8aa0623d88017900d038ca2deee9b40ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# $Id: PKGBUILD 160040 2012-05-28 13:39:12Z guillaume $
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Andrew Wright <andreww@photism.org>
# Contributor: Paul Mattal <paul@archlinux.org>
pkgname=apache-ant
pkgver=1.8.4
pkgrel=1
pkgdesc="A java-based build tool"
arch=('any')
url="http://ant.apache.org/"
license=('APACHE')
depends=('java-environment')
makedepends=('java-environment' 'xalan-java' 'junit' 'apache-ant')
optdepends=('junit: to jave junit on the classpath in javac tasks')
#http://apache.org/dist/ant/source/${pkgname}-${pkgver}-src.tar.bz2
source=(http://apache.org/dist/ant/binaries/${pkgname}-${pkgver}-bin.tar.bz2
        ${pkgname}.sh
        ${pkgname}.csh)
md5sums=('561838e665e5dc185dde9d220fce1336'
         'dbfa1e8dd4bab2f5821f5abe50835c83'
         'b3f67824043b6fb00667bb7a4007af42')

_ant_home=/usr/share/${pkgname}

#build() {
#  cd "${srcdir}/${pkgname}-${pkgver}"

#  ant -Ddest=optional -f fetch.xml

#  ln -s /usr/share/java/junit.jar lib/optional/junit.jar
#  ./bootstrap.sh

#  mkdir ${srcdir}/.m2
#  ./bootstrap/bin/ant -Ddest=optional -Ddest.dir=${srcdir}/.m2 -f fetch.xml
#  ./bootstrap/bin/ant -f fetch.xml -nouserlib -Ddest=optional

#  sh build.sh dist

#  ant dist
#}

package() {
#  cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}-${pkgver}"
  cd "${srcdir}/${pkgname}-${pkgver}"

  install -dm755 ${pkgdir}/${_ant_home}/bin
  cp -Rp etc ${pkgdir}/${_ant_home}
  find ./bin -type f -a ! -name \*.bat -a ! -name \*.cmd \
    -exec install -m755 {} ${pkgdir}/${_ant_home}/bin \;

  install -dm755 ${pkgdir}/usr/bin
  ln -s ${_ant_home}/bin/ant ${pkgdir}/usr/bin/ant

  install -dm755 ${pkgdir}/usr/share/java/${pkgname}
  install -m644 lib/*.jar ${pkgdir}/usr/share/java/${pkgname}
  ln -s /usr/share/java/${pkgname} ${pkgdir}/${_ant_home}/lib

  # Symlink to junit so it's on the javac build path
  # http://bugs.archlinux.org/task/15229
  # http://ant.apache.org/manual/install.html#optionalTasks
  ln -sf ../junit.jar ${pkgdir}/usr/share/java/apache-ant/

  # fix python2 path
  sed -i 's|/usr/bin/python|/usr/bin/python2|' ${pkgdir}${_ant_home}/bin/runant.py

  # install profile.d script
  install -dm755 ${pkgdir}/etc/profile.d
  install -m755 "${srcdir}"/${pkgname}.{csh,sh} ${pkgdir}/etc/profile.d/

  # License says NOTICE file should be redistributed for derivative works
  cd ${srcdir}/${pkgname}-${pkgver}
  install -dm755 ${pkgdir}/usr/share/licenses/${pkgname}
  install -m644 LICENSE NOTICE ${pkgdir}/usr/share/licenses/${pkgname}
}