summaryrefslogtreecommitdiff
path: root/pcr/jzlib/PKGBUILD
blob: 22f1cb84b26431ce61f8ae7731324cad10fce56d (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=jzlib
pkgver=1.1.3
pkgrel=1
pkgdesc="Java Zlib implementation"
arch=('any')
url="http://www.jcraft.com/jzlib/"
license=('BSD')
depends=('java-runtime')
makedepends=('java-environment' 'jh')
source=("https://github.com/ymnk/${pkgname}/archive/${pkgver}.zip")
md5sums=('9613fd3b704247daa68a288f368efe29')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  mkdir -p build/classes
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  javac -d "build/classes" $(find "src/main/java" -name \*.java)
  javadoc -sourcepath "src/main/java" -d "build/javadoc" com.jcraft.jzlib

  jar -cvf "${pkgname}.jar" -C "build/classes" .
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

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

  # Install documentation
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r "build/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r "example" "${pkgdir}/usr/share/doc/${pkgname}/examples"

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install "com.jcraft" ${pkgname} ${pkgver} \
    "${srcdir}/${pkgname}-${pkgver}/pom.xml" \
    "${srcdir}/${pkgname}-${pkgver}/${pkgname}.jar" \
    "${pkgname}.jar"
  ln -s "/usr/share/java/${pkgname}.jar" \
    "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.jar"
}