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

_libname=saxon
pkgname=${_libname}6
pkgver=6.5.5
_pkgver=$(echo $pkgver | tr . -)
pkgrel=1
pkgdesc="XSLT 1.0 / XPath 1.0 processor for Java"
url="http://saxon.sourceforge.net/"
license=('MPL')
arch=('any')
depends=('java-runtime')
makedepends=('java-environment' 'java-jdom1' 'jh')
source=("http://sourceforge.net/projects/${_libname}/files/$pkgname/$pkgver/${_libname}${_pkgver}.zip"
        'pom.xml')
sha1sums=('15e25fcf561ff173751ae992f2608f6f2e6204ed'
          'f9352e1e204e4cf93f2a33335288ceff9b3e2f16')

prepare() {
  cd ${srcdir}
  rm -rv *.jar
  rm -rvf {doc,samples}
  mkdir -p {build/classes,src}
  bsdtar -zxf source.zip -C src
}

build() {
  cd $srcdir
  CLASSPATH="/usr/share/java/jdom1.jar"
  javac -cp $CLASSPATH -d build/classes -encoding ISO-8859-1 \
    $(find src -name \*.java)
  javadoc -classpath $CLASSPATH -d build/javadoc -encoding ISO-8859-1 \
    -sourcepath src -subpackages com:org

  jar -cvf "${_libname}-jdom.jar" -C build/classes/ com/icl/saxon/jdom

  rm -r build/classes/com/icl/saxon/jdom
  jar -cvf "${_libname}.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 ${_libname} ${_libname} $pkgver \
    pom.xml \
    "${_libname}.jar" \
    "${_libname}-$pkgver.jar"
  ln -s "/usr/share/java/${_libname}-$pkgver.jar" \
    "$pkgdir/usr/share/java/${_libname}.jar"

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