archrelease: copy trunk to community-any
[ArchLinux/community.git] / cfr / repos / community-any / PKGBUILD
blob802d705b09a0af3968bf85d9bb96b8e80e0a9b09
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: lukas <lukas <dot> graetz <at> web <dot>  de>
3 # Contributor: Graham Edgecombe <graham@grahamedgecombe.com>
5 pkgname=cfr
6 pkgver=0.152
7 pkgrel=2
8 pkgdesc='Another Java decompiler'
9 arch=('any')
10 url='https://www.benf.org/other/cfr/'
11 license=('MIT')
12 depends=('java-runtime')
13 makedepends=('git' 'maven' 'jdk8-openjdk')
14 _commit='68477be3ff7171ee17ddd1a26064b9b253f1604f'
15 source=(
16   "$pkgname::git+https://github.com/leibnitz27/cfr#commit=$_commit"
17   "github.com-leibnitz27-cfr_tests::git+https://github.com/leibnitz27/cfr_tests"
18   'wrapper.sh'
19   'maven-repro.patch'
21 b2sums=('SKIP'
22         'SKIP'
23         'a64a64c44b790f87136bff0fda79ec077bfe156ff9b4cb4a47c77dede07dcb5334f5b6443e1228ebd8442b48c7a6f86dde99a299de7decb2aa7205de66e3b8ce'
24         '68c34fe8ea6a91ee58561b86cdb34020ef9a4ac3fda65f67c8a5eb3386546d5416a05f2a02f86c83eee4be9b63859297d563fe2908d8bec5fa1eacb616b2e573')
26 pkgver() {
27   cd "$pkgname"
29   git describe --tags | sed 's/^v//'
32 prepare() {
33   cd "$pkgname"
35   # prepare git submodules
36   git submodule init
38   git config submodule.decompilation-test/test-data.url "$srcdir/github.com-leibnitz27-cfr_tests"
40   git -c protocol.file.allow=always submodule update
42   # ensure reproducible builds
43   patch -p1 -i "$srcdir/maven-repro.patch"
46 build() {
47   cd "$pkgname"
49   # Force the system to build the package using JDK 8
50   export PATH="/usr/lib/jvm/java-8-openjdk/bin/:$PATH"
51   export JAVA_HOME="/usr/lib/jvm/java-8-openjdk"
53   mvn package
56 package() {
57   cd "$pkgname"
59   # wrapper script
60   install -vDm755 "$srcdir/wrapper.sh" "$pkgdir/usr/bin/$pkgname"
62   # jar
63   install -vDm644 "target/$pkgname-$pkgver.jar" "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
65   # license
66   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
68   # documentation
69   install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md