aboutsummaryrefslogtreecommitdiffstats
path: root/community/john/APKBUILD
blob: fc4968eb918c50c281d437227908009d9072b7b4 (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
# Contributor: Ivan Tham <pickfire@riseup.net>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=john
pkgver=1.9.0
_pkgrel=jumbo-1
pkgrel=1
pkgdesc="John the Ripper password cracker"
url="https://www.openwall.com/john"
arch="all !s390x !x86 !ppc64le"
license="GPL-2.0-or-later"
depends="nss"
options="!strip"
makedepends="libpcap-dev openssl-dev gmp-dev yasm-dev zlib-dev"
subpackages="$pkgname-doc"

source="$pkgname-$pkgver.tar.gz::https://github.com/magnumripper/JohnTheRipper/archive/$pkgver.tar.gz"
builddir="$srcdir"/JohnTheRipper-$pkgver

build() {
	cd "$builddir"/src
	local _arch=
	case "$CARCH" in
		aarch64) _arch=arm64le;;
		arm*) _arch=arm32le;;
		ppc64le) _arch=ppc64;;
		x86) _arch=x86-any;;
		x86_64) _arch=x86-64;
	esac

	make linux-$_arch
}

check() {
	cd "$builddir"/run
	./john --test
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname

	install -Dm644 run/john.conf "$pkgdir"/etc/john/john.conf
	install -Dm644 doc/* "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 doc/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	rm "$pkgdir"/usr/share/doc/$pkgname/LICENSE*

	find run -type f -executable | while read bin; do
		install -Dm755 $bin "$pkgdir"/usr/bin
	done

	for link in unafs unique unshadow; do
		ln -s john "$pkgdir"/usr/bin/$link
	done
	install -Dm644 run/password.lst "$pkgdir"/usr/share/john/password.lst
}

sha512sums="408e67b0aff67b37fe20f7a07ccdd1e3d4788c68866974c970d091ab41977bfe1c9cc72417f3320ff0b910516093c9fe0023cd8a214d086b5754a224eff01709  john-1.9.0.tar.gz"