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

pkgname=xz-java
pkgver=1.6
pkgrel=1
pkgdesc="Java library for XZ and LZMA compression"
arch=('any')
url="http://tukaani.org/xz/java.html"
license=('Public Domain')
depends=('java-runtime')
makedepends=('java-environment' 'jh')
source=("http://tukaani.org/xz/$pkgname-$pkgver.zip")
sha256sums=('1da9c5534656da8197457feeea7ee6c7a2c908e94f01db6d3c80ee17620e77fc')

prepare() {
  cd $srcdir
  cp maven/pom_template.xml pom.xml
  sed -i "s,@VERSION@,$pkgver,g; \
          s,@TITLE@,XZ data compression,g; \
          s,@HOMEPAGE@,$url,g" pom.xml
  mkdir -p build/classes
}

build() {
  cd $srcdir
  javac -d build/classes $(find src/org -name \*.java)
  javadoc -d build/javadoc -sourcepath src -subpackages org
  jar -cvf xz.jar -C build/classes .
}

package() {
  cd $srcdir

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

  # 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 org.tukaani xz $pkgver \
    pom.xml xz.jar "xz-$pkgver.jar"

  ln -s "/usr/share/java/xz-$pkgver.jar" \
    "$pkgdir/usr/share/java/xz.jar"
}