summaryrefslogtreecommitdiff
path: root/pcr/java-jarjar/PKGBUILD
blob: 7b50bf171a5b19b5713bfb4e31feab97dfeeefae (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>

_pkgname=jarjar
pkgname=java-${_pkgname}
pkgver=1.4
pkgrel=1
pkgdesc="Repackage third-party jars"
arch=('any')
url="https://code.google.com/p/jarjar/"
license=('APACHE')
depends=('java-runtime')
makedepends=('apache-ant' 'java-asm' 'jh' 'maven' 'subversion')
source=("${_pkgname}-${pkgver}::svn+https://jarjar.googlecode.com/svn/trunk/jarjar/"
        "jarjar-fix_javadocs.patch")
md5sums=('SKIP'
         'f6f003fe768eaa487a2624d1dba41ce3')

prepare() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  find . -name \*.jar -delete
  sed -i 's/1\.3/1\.4/g' pom.xml
  patch -Np1 -i "${srcdir}/jarjar-fix_javadocs.patch"
}

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

  ln -s "/usr/share/java/asm-4.jar" "lib/asm-4.0.jar"
  ln -s "/usr/share/java/asm-commons-4.jar" "lib/asm-commons-4.0.jar"
  ln -s "/opt/maven/lib/maven-plugin-api-3.3.3.jar" "lib/maven-plugin-api.jar"

  ant jar javadoc \
    -Dant.jar=/opt/apache-ant/lib/ant.jar
}

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

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

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