summaryrefslogtreecommitdiff
path: root/pcr/java-qdox/PKGBUILD
blob: 1b7bd2ef606096c6d0d18f15ee0867e0a8a9181c (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
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_pkgname=qdox
pkgname=java-${_pkgname}
pkgver=1.12.1
pkgrel=1
pkgdesc="Quickly parses declarations and Javadoc from Java source"
arch=('any')
url="http://qdox.codehaus.org"
license=('APACHE')
depends=('java-runtime')
makedepends=('apache-ant' 'jh' 'junit')
source=("http://repo1.maven.org/maven2/com/thoughtworks/${_pkgname}/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}-sources.jar"
        "http://repo1.maven.org/maven2/com/thoughtworks/${_pkgname}/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}.pom")
md5sums=('153ec1212a9fcf7986cd61909c05fd5b'
         'ac2b4b3cfe6d594797940ba73f140cf7')

prepare() {
  cd ${srcdir}
  mkdir -p "build/classes"
}

build() {
  cd ${srcdir}

  CLASSPATH="/opt/apache-ant/lib/ant.jar:/usr/share/java/junit.jar"
  javac -classpath $CLASSPATH -d "build/classes" $(find . -name \*.java)
  javadoc -classpath $CLASSPATH -d "build/javadoc" -sourcepath . -subpackages com

  jar -cvf "${_pkgname}.jar" -C "build/classes" .
}

package() {
  cd ${srcdir}

  # Install documentation
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r "build/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install "com.thoughtworks.qdox" ${_pkgname} ${pkgver} \
    "${srcdir}/${_pkgname}-${pkgver}.pom" \
    "${srcdir}/${_pkgname}.jar" \
    "${_pkgname}.jar"
  ln -s "/usr/share/java/${_pkgname}.jar" \
    "${pkgdir}/usr/share/java/${_pkgname}-${pkgver}.jar"
}