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

pkgname=jericho-html
pkgver=3.3
pkgrel=1
pkgdesc='Java based library for HTML Parsing'
arch=('any')
url='http://jericho.htmlparser.net'
license=('LGPL')
depends=('java-runtime')
makedepends=('java-environment' 'java-commons-logging' 'log4j-1.2' 'slf4j')
source=("http://downloads.sourceforge.net/jerichohtml/$pkgname-$pkgver.zip")
sha256sums=('236bc63259da9fe1b13d54f2b84e6c74ca5d9bea46b4db66eb136027dc821f5b')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  rm -rv {compile-time-dependencies,dist,docs,samples,test/lib}
  mkdir -p build/classes
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  CLASSPATH="/usr/share/java/commons-logging.jar"
  CLASSPATH+=":/usr/share/java/log4j-1.2.jar"
  CLASSPATH+=":/usr/share/java/slf4j-api.jar"
  javac -cp $CLASSPATH -d build/classes -encoding ISO-8859-1 \
    $(find src/java -name \*.java)
  javadoc -classpath $CLASSPATH -d build/javadoc -encoding ISO-8859-1 \
    -sourcepath src/java -subpackages net

  jar -cvf $pkgname-$pkgver.jar -C build/classes .
}

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

  # Install license file
  install -Dm644 licence.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"

  # Install jar
  install -Dm755 "$pkgname-$pkgver.jar" \
    "$pkgdir/usr/share/java/$pkgname/$pkgname-$pkgver.jar"
  ln -s "/usr/share/java/$pkgname/$pkgname-$pkgver.jar" \
    "$pkgdir/usr/share/java/$pkgname.jar"
}