summaryrefslogtreecommitdiff
path: root/libre/xerces2-java/PKGBUILD
blob: aaf2811a787a2fd003a76af8b1bed69209fceeaf (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
62
63
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_libname=xerces2
pkgname=${_libname}-java
pkgver=2.11.0
pkgrel=3.parabola1
pkgdesc="High performance fully compliant Java XML parser"
arch=('any')
url="http://xml.apache.org/xerces2-j"
license=('APACHE')
depends=('java-runtime' 'java-resolver' 'java-xml-commons-external')
makedepends=('apache-ant' 'java-resolver' 'java-xml-commons-external' 'jh')
provides=("java-xerces2=${pkgver}")
conflicts=('java-xerces2')
replaces=('java-xerces2')
source=("http://archive.apache.org/dist/xerces/j/Xerces-J-src.${pkgver}.tar.gz"
        "http://repo.maven.apache.org/maven2/xerces/xercesImpl/${pkgver}/xercesImpl-${pkgver}.pom"
        "xerces2-java-taskdef.patch"
        "xerces2-java-dont_unzip.patch"
        "xerces2-java-HTMLObjectElementImpl.patch")
md5sums=('d01fc11eacbe43b45681cb85ac112ebf'
         '64288948e6420e49679348b0ce1963f8'
         '600788add1665864495e2bd0ab015613'
         '3bd20b2ea82f14d77031bf0e49c03516'
         'e1c26eeaedd33dc0a7af493a07a17211')

prepare() {
  cd "${srcdir}/xerces-${pkgver//./_}"
  mkdir -p tools
  patch -Np1 -i ../xerces2-java-taskdef.patch
  patch -Np1 -i ../xerces2-java-dont_unzip.patch
  patch -Np1 -i ../xerces2-java-HTMLObjectElementImpl.patch
}

build() {
  cd "${srcdir}/xerces-${pkgver//./_}"
  ln -sf /usr/share/java/resolver.jar tools/resolver.jar
  ln -sf /usr/share/java/xml-apis.jar tools/xml-apis.jar

  ant clean jar sampjar javadocs
}

package() {
  cd "${srcdir}/xerces-${pkgver//./_}"

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

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

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install xerces xercesImpl ${pkgver} \
    "${srcdir}/xercesImpl-${pkgver}.pom" \
    "build/xercesImpl.jar" \
    "xercesImpl.jar"

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