summaryrefslogtreecommitdiff
path: root/libre/proguard/PKGBUILD
blob: 096fbc51870e1b4530e95e607c73ac45e3ebc2b7 (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
# $Id$
# Maintainer (Arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=proguard
pkgver=5.2.1
pkgrel=1.parabola1
pkgdesc="free Java class file shrinker, optimizer, obfuscator, and preverifier"
arch=(any)
url="http://proguard.sourceforge.net/"
license=('GPL2')
depends=('java-runtime')
makedepends=('apache-ant' 'gradle' 'jh')
source=(http://downloads.sourceforge.net/proguard/proguard$pkgver.tar.gz
        proguard-fix_build.patch)
md5sums=('e94cf25b7947a0d3bbe7410f87f87c58'
         'e6ca4ce58dc2ccdd860203e37687e82a')

prepare() {
  cd "$srcdir/$pkgname$pkgver"
  rm -rv lib/*.jar
  rm -rv {docs,examples}
  patch -Np1 -i "${srcdir}/proguard-fix_build.patch"
}

build() {
  cd "$srcdir/$pkgname$pkgver"
  ant basic anttask gradletask \
    -f buildscripts/build.xml \
    -Dgradle.home=/usr/share/java/gradle
}

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

  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/usr/share/proguard
  install -D -m0644 proguardgui.jar proguard.jar retrace.jar $pkgdir/usr/share/proguard/

  cat >$pkgdir/usr/bin/proguardgui <<EOF
#!/bin/sh
exec java -jar /usr/share/proguard/proguardgui.jar \$*
EOF
  chmod 0755 $pkgdir/usr/bin/proguardgui

  cat >$pkgdir/usr/bin/proguard <<EOF
#!/bin/sh
exec java -jar /usr/share/proguard/proguard.jar \$*
EOF
  chmod 0755 $pkgdir/usr/bin/proguard

  # FS#36268
  ln -s . $pkgdir/usr/share/proguard/lib

  # Install Maven artifacts
  export DESTDIR=$pkgdir
  for artifact in base gradle; do
    jh mvn-install net.sf.proguard $pkgname-$artifact $pkgver \
      "../buildscripts/maven/$artifact/pom.xml" \
      "$pkgname.jar"
  done
}