PKGBUILD 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  2. _libname=xmlgraphics-commons
  3. pkgname=java-${_libname}
  4. pkgver=2.1
  5. pkgrel=1.parabola1
  6. pkgdesc="Common components between FOP and Batik."
  7. arch=('any')
  8. url="http://xmlgraphics.apache.org/commons/"
  9. license=('APACHE')
  10. depends=('java-runtime')
  11. makedepends=('java-commons-io' 'java-commons-logging' 'java-environment' 'jh')
  12. source=("https://archive.apache.org/dist/xmlgraphics/commons/source/${_libname}-${pkgver}-src.tar.gz")
  13. md5sums=('57c14bf1b8aef8a36f00e943215ffd21')
  14. prepare() {
  15. cd "${srcdir}/${_libname}-${pkgver}"
  16. rm -v $(find . -name \*.jar)
  17. mkdir -p build/classes
  18. sed -i "s/@version@/${pkgver}/g" xmlgraphics-commons-pom-template.pom
  19. }
  20. build() {
  21. cd "${srcdir}/${_libname}-${pkgver}"
  22. CLASSPATH="/usr/share/java/commons-io.jar:/usr/share/java/commons-logging.jar"
  23. javac -encoding UTF-8 -classpath $CLASSPATH -d "build/classes" \
  24. $(find "src/java" -name \*.java)
  25. javadoc -encoding UTF-8 -classpath $CLASSPATH -d "build/javadoc" \
  26. -sourcepath "src/java" -subpackages org
  27. jar -cvf "${_libname}.jar" -C "build/classes" .
  28. }
  29. package() {
  30. cd "${srcdir}/${_libname}-${pkgver}"
  31. # Install documentation
  32. install -d "${pkgdir}/usr/share/doc/${pkgname}"
  33. cp -r "build/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"
  34. cp -r "examples/java" "${pkgdir}/usr/share/doc/${pkgname}/examples"
  35. # Install Maven artifacts
  36. export DESTDIR=${pkgdir}
  37. jh mvn-install "org.apache.xmlgraphics" ${_libname} ${pkgver} \
  38. "${srcdir}/${_libname}-${pkgver}/${_libname}-pom-template.pom" \
  39. "${_libname}.jar" \
  40. "${_libname}-${pkgver}.jar"
  41. ln -s "/usr/share/java/${_libname}-${pkgver}.jar" \
  42. "${pkgdir}/usr/share/java/${_libname}.jar"
  43. install -d "${pkgdir}/usr/share/java/${_libname}"
  44. ln -s "/usr/share/java/${_libname}.jar" \
  45. "${pkgdir}/usr/share/java/${_libname}/${_libname}.jar"
  46. }