PKGBUILD 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  2. pkgname=java-batik
  3. pkgver=1.9
  4. pkgrel=1.parabola1
  5. pkgdesc='SVG library for Java.'
  6. arch=('any')
  7. url='http://xmlgraphics.apache.org/batik/'
  8. license=(APACHE)
  9. depends=('java-runtime' 'java-commons-io' 'java-commons-logging' 'java-xmlgraphics-commons'
  10. 'java-xml-commons-external' 'rhino' 'xalan-java' 'xerces2-java')
  11. makedepends=('java-environment' 'apache-ant' 'unzip' 'jh'
  12. 'rhino' 'xalan-java')
  13. source=("https://www.apache.org/dist/xmlgraphics/batik/source/batik-src-$pkgver.tar.gz")
  14. sha256sums=('bef436c0b4ac9a499274a8df9a2769f42ddc6553451dac9a9514b4f55d06c6a3')
  15. prepare() {
  16. cd "batik-$pkgver"
  17. rm -rv lib/*
  18. rm -rv documentation-sources/content/demo/*.jar
  19. ln -sf /usr/share/java/xml-apis.jar lib/xml-apis.jar
  20. ln -sf /usr/share/java/xml-apis-ext.jar lib/xml-apis-ext.jar
  21. #ln -sf /usr/share/java/xalan.jar lib/xalan.jar
  22. #ln -sf /usr/share/java/xercesImpl.jar lib/xercesImpl.jar
  23. ln -sf /usr/share/java/xmlgraphics-commons.jar lib/xmlgraphics-commons.jar
  24. }
  25. build() {
  26. cd "batik-$pkgver"
  27. # ant all-jar libs-jar ext-jar transcoder-jar
  28. ant jars libs-jar all-jar
  29. }
  30. package() {
  31. cd "batik-$pkgver/batik-$pkgver"
  32. # Install license file
  33. install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  34. # Install Maven artifacts
  35. export DESTDIR=$pkgdir
  36. for artifact in $(find . -name "batik-*-*.jar" ! -name '*-libs-*.jar' | sed 's/-[0-9.]*\.jar$//'); do
  37. _dir=$(dirname $artifact)
  38. _artifact=$(basename $artifact)
  39. jh mvn-install "org.apache.xmlgraphics" ${_artifact} $pkgver \
  40. "../${_artifact}/pom.xml" \
  41. "${_dir}/${_artifact}-$pkgver.jar" \
  42. "${_artifact}-$pkgver.jar"
  43. # Symlink them to /usr/share/java
  44. ln -s "/usr/share/java/${_artifact}-$pkgver.jar" \
  45. "$pkgdir/usr/share/java/${_artifact}.jar"
  46. done
  47. # Install batik-all.jar and batik-libs.jar
  48. install -d "$pkgdir/usr/share/java/batik"
  49. install -m644 "lib/batik-all-$pkgver.jar" \
  50. "$pkgdir/usr/share/java/batik/"
  51. install -m644 "lib/batik-libs-$pkgver.jar" \
  52. "$pkgdir/usr/share/java/batik/"
  53. ln -s "/usr/share/java/batik/batik-all-$pkgver.jar" \
  54. "$pkgdir/usr/share/java/batik/batik-all.jar"
  55. ln -s "/usr/share/java/batik/batik-libs-$pkgver.jar" \
  56. "$pkgdir/usr/share/java/batik/batik-libs.jar"
  57. }