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

_libname=jdom
pkgname=java-${_libname}1
pkgver=1.1.3
pkgrel=1.parabola2
pkgdesc="Older version of XML Parsing Library for Java"
arch=('any')
url="http://www.jdom.org"
license=('custom')
depends=('java-runtime')
conflicts=('java-jdom')
provides=("java-jdom=$pkgver")
makedepends=('apache-ant' 'jh')
source=("https://github.com/hunterhacker/${_libname}/archive/${_libname}-$pkgver.tar.gz")
sha1sums=('2a8d80da5046b62b3130ab22eda058e8f02a6ade')

prepare() {
  cd "$srcdir/${_libname}-${_libname}-$pkgver"
  rm -rv {core,contrib,test}/lib/*.jar
  sed -i "s/@artifactID@/${_libname}/g" maven.pom
  sed -i "s/@version@/$pkgver/g" maven.pom
  sed -i "s/@jdk@/1.2/g" maven.pom
}

build() {
  cd "$srcdir/${_libname}-${_libname}-$pkgver"
  ant build.core \
    -Dversion=$pkgver
}

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

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

  # Install documentation
  install -d "$pkgdir/usr/share/doc/$pkgname"
  cp -r core/build/apidocs "$pkgdir/usr/share/doc/$pkgname"
  cp -r core/samples "$pkgdir/usr/share/doc/$pkgname/examples"

  # Install Maven artifacts
  export DESTDIR=$pkgdir
  jh mvn-install "org.${_libname}" ${_libname} $pkgver \
    maven.pom \
    "core/build/${_libname}-$pkgver.jar" \
    "${_libname}-$pkgver.jar"
  ln -s "/usr/share/java/${_libname}-$pkgver.jar" \
    "${pkgdir}/usr/share/java/${_libname}1.jar"
}