summaryrefslogtreecommitdiff
path: root/libre/java-batik/PKGBUILD
blob: a279a465240fc0a487e72a2416906ded4a10e460 (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
75
76
77
78
79
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=java-batik
pkgver=1.14
pkgrel=1.parabola1
pkgdesc='SVG library for Java.'
arch=('any')
url='http://xmlgraphics.apache.org/batik/'
license=(APACHE)
depends=('java-runtime' 'java-commons-io' 'java-commons-logging' 'java-xmlgraphics-commons'
         'java-xml-commons-external' 'rhino' 'xalan-java' 'xerces2-java')
makedepends=('java-environment' 'apache-ant' 'unzip' 'jh'
             'rhino' 'xalan-java')
source=("https://www.apache.org/dist/xmlgraphics/batik/source/batik-src-$pkgver.tar.gz"{,.asc})
sha256sums=('23ece6f0c31be3a4123173e5d2f49090239d71ff7a9762c45c6170fcc4c33bbc'
            'SKIP')
sha512sums=('689c52f58f8f0456c89bd18745d2d92e7590b9054bea71b96be87d44977057d583e78504cbf14afc3e0c585d2383dac3009c7c421de868c847db045e921da8fb'
            'SKIP')
validpgpkeys=('5C9A30FF22B2C02F30261C305B93F1DF7CDB6DEA') # Simon Steiner (CODE SIGNING KEY) <ssteiner@apache.org>

# TODO:
# fop-transcoder-allinone-2.6.jar
# rhino-1.7.7.jar
# serializer-2.7.2.jar
# xalan-2.7.2.jar
# xercesImpl-2.12.0.jar
# xml-apis-1.4.01.jar
# xml-apis-ext-1.3.04.jar
# xmlgraphics-commons-2.6.jar

prepare() {
  cd "batik-$pkgver"
  rm -rv lib/*
  rm -rv documentation-sources/content/demo/*.jar
  ln -sf /usr/share/java/xml-apis.jar lib/xml-apis.jar
  ln -sf /usr/share/java/xml-apis-ext.jar lib/xml-apis-ext.jar
  ln -sf /usr/share/java/xmlgraphics-commons.jar lib/xmlgraphics-commons.jar
}

build() {
  cd "batik-$pkgver"
#  ant all-jar libs-jar ext-jar transcoder-jar
  ant jars libs-jar all-jar
}

package() {
  cd "batik-$pkgver/batik-$pkgver"

  # Install license file
  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # Install Maven artifacts
  export DESTDIR=$pkgdir
  for artifact in $(find . -name "batik-*-*.jar" ! -name '*-libs-*.jar' | sed 's/-[0-9.]*\.jar$//'); do
    _dir=$(dirname $artifact)
    _artifact=$(basename $artifact)

    jh mvn-install "org.apache.xmlgraphics" ${_artifact} $pkgver \
      "../${_artifact}/pom.xml" \
      "${_dir}/${_artifact}-$pkgver.jar" \
      "${_artifact}-$pkgver.jar"

    # Symlink them to /usr/share/java
    ln -s "/usr/share/java/${_artifact}-$pkgver.jar" \
      "$pkgdir/usr/share/java/${_artifact}.jar"
  done

  # Install batik-all.jar and batik-libs.jar
  install -d "$pkgdir/usr/share/java/batik"
  install -m644 "lib/batik-all-$pkgver.jar" \
    "$pkgdir/usr/share/java/batik/"
  install -m644 "lib/batik-libs-$pkgver.jar" \
    "$pkgdir/usr/share/java/batik/"

  ln -s "/usr/share/java/batik/batik-all-$pkgver.jar" \
    "$pkgdir/usr/share/java/batik/batik-all.jar"
  ln -s "/usr/share/java/batik/batik-libs-$pkgver.jar" \
    "$pkgdir/usr/share/java/batik/batik-libs.jar"
}