summaryrefslogtreecommitdiff
path: root/libre/java-xmlgraphics-commons/PKGBUILD
blob: 078f0d8a76800b32777e872a18ea8f021ce84953 (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
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_libname=xmlgraphics-commons
pkgname=java-${_libname}
pkgver=2.7
pkgrel=1.parabola1
pkgdesc="Common components between FOP and Batik."
arch=('any')
url="http://xmlgraphics.apache.org/commons/"
license=('APACHE')
depends=('java-runtime')
makedepends=('java-commons-io' 'java-commons-logging' 'java-environment' 'jh')
source=("https://archive.apache.org/dist/xmlgraphics/commons/source/${_libname}-${pkgver}-src.tar.gz"{,.asc})
sha512sums=('7d3993fc920767512f94edef3342757f0ffc9c9dbad80695fe3d77b0ec162380d9b467682ae41238e7ee719601709edb41b2dab06c385dfd9fa898577d8d2c22'
           'SKIP')
validpgpkeys=('5C9A30FF22B2C02F30261C305B93F1DF7CDB6DEA') # Simon Steiner (CODE SIGNING KEY) <ssteiner@apache.org>

prepare() {
  cd "${srcdir}/${_libname}-${pkgver}"
  rm -v $(find . -name \*.jar)
  mkdir -p build/classes
  sed -i "s/@version@/${pkgver}/g" xmlgraphics-commons-pom-template.pom 
}

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

  CLASSPATH="/usr/share/java/commons-io.jar:/usr/share/java/commons-logging.jar"
  javac -encoding UTF-8 -classpath $CLASSPATH -d "build/classes" \
    $(find "src/java" -name \*.java)
  javadoc -encoding UTF-8 -classpath $CLASSPATH -d "build/javadoc" \
    -sourcepath "src/java" -subpackages org

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

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

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

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install "org.apache.xmlgraphics" ${_libname} ${pkgver} \
    "${srcdir}/${_libname}-${pkgver}/${_libname}-pom-template.pom" \
    "${_libname}.jar" \
    "${_libname}-${pkgver}.jar"
  ln -s "/usr/share/java/${_libname}-${pkgver}.jar" \
    "${pkgdir}/usr/share/java/${_libname}.jar"

  install -d "${pkgdir}/usr/share/java/${_libname}"
  ln -s "/usr/share/java/${_libname}.jar" \
    "${pkgdir}/usr/share/java/${_libname}/${_libname}.jar"
}