# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=john pkgver=1.8.0 _pkgrel=jumbo-1 pkgrel=3 pkgdesc="John the Ripper password cracker" url="http://www.openwall.com/john" arch="x86_64 armhf" license="GPL2" depends="nss" options="!strip" makedepends="libpcap-dev openssl-dev gmp-dev yasm-dev" install="" subpackages="$pkgname-doc \ $pkgname-scripts-py:py \ $pkgname-scripts-perl:perl \ $pkgname-scripts-ruby:ruby \ $pkgname-misc \ $pkgname-zsh-completion:zshcomp \ $pkgname-bash-completion:bashcomp" source="$pkgname-$pkgver.tar.gz::https://github.com/magnumripper/JohnTheRipper/archive/$pkgver-$_pkgrel.tar.gz truecrypt_fmt_plug.patch params-h.patch gcc5-support.patch" builddir="$srcdir/JohnTheRipper-$pkgver-$_pkgrel" build() { cd "$builddir"/src sed -i -e "s/ac_default_prefix.*/ac_default_prefix=\/usr/g" configure ./configure \ --disable-openmp make || return 1 } package() { cd "$builddir" mkdir -p "$pkgdir"/usr/bin mkdir -p "$pkgdir"/usr/share/doc/$pkgname install -Dm644 run/john.conf ${pkgdir}/etc/john/john.conf install -Dm644 run/john.local.conf ${pkgdir}/etc/john/john.local.conf install -Dm644 doc/* ${pkgdir}/usr/share/doc/$pkgname install -Dm644 doc/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE local john_bins="john calc_stat genmkvpwd mkvcalcproba \ relbench tgtsnarf raw2dyna" for bin in $(echo ${john_bins}); do install -Dm755 run/${bin} -t "${pkgdir}/usr/bin" done cd "${pkgdir}/usr/bin" local john_links="hccap2john keepass2john mozilla2john \ pdf2john pfx2john pwsafe2john racf2john \ rar2john ssh2john unafs unique unsahdow \ undrop zip2john" for link in $(echo ${john_links}); do ln -s john ${link} done } py() { pkgdesc="Python Scripts for John the Ripper" arch=noarch depends="python libxml2 libgsf" install_if="$pkgname=$pkgver-r$pkgrel" cd "$builddir" local john_scripts="1password2john.py ecryptfs2john.py \ kwallet2john.py openssl2john.py 7z2john.py efs2john.py \ lotus2john.py pcap2john.py aix2john.py encfs2john.py \ mcafee_epo2john.py pdf2john.py androidfde2john.py \ htdigest2john.py ml2john.py sipdump2john.py \ apex2john.py ikescan2john.py mozilla2john.py \ ssh2sshng.py bitcoin2john.py kdcdump2john.py \ netscreen.py sshng2john.py blockchain2john.py \ keychain2john.py odf2john.py strip2john.py \ cracf2john.py keystore2john.py office2john.py \ sxc2john.py dmg2john.py known_hosts2john.py \ openbsd_softraid2john.py" for john_script in $(echo ${john_scripts}); do install -D -m755 run/${john_script} \ "$subpkgdir"/usr/share/john done } perl() { pkgdesc="Perl Scripts for John the Ripper" arch=noarch depends="perl" install_if="$pkgname=$pkgver-r$pkgrel" cd "$builddir" local john_scripts="aix2john.pl ios7tojohn.pl \ lion2john-alt.pl pass_gen.pl sap2john.pl \ cisco2john.pl ldif2john.pl lion2john.pl \ radius2john.pl sha-dump.pl hextoraw.pl \ leet.pl netntlm.pl rexgen2rules.pl \ sha-test.pl benchmark-unify" for john_script in $(echo ${john_scripts}); do install -D -m755 run/${john_script} \ "$subpkgdir"/usr/share/john done } ruby() { pkgdesc="Ruby Scripts for John the Ripper" arch=noarch depends="ruby" install_if="$pkgname=$pkgver-r$pkgrel" cd "$builddir" local john_scripts="genincstats.rb" for john_script in $(echo ${john_scripts}); do install -D -m755 run/${john_script} \ "$subpkgdir"/usr/share/john done } misc() { pkgdesc="Misc tools for John the Ripper: password list and charset files" arch=noarch install_if="$pkgname=$pkgver-r$pkgrel" cd "$builddir" mkdir -p ${subpkgdir}/usr/share/john/kernels/ local john_pwdfiles="password.lst dictionary.rfc2865 stats" local john_conffiles="dumb16.conf dumb32.conf dynamic.conf \ dynamic_flat_sse_formats.conf regex_alphabets.conf \ repeats16.conf repeats32.conf" local john_chrfiles="lowernum.chr alnum.chr upper.chr lower.chr \ alpha.chr ascii.chr latin1.chr lanman.chr \ lowerspace.chr digits.chr lm_ascii.chr utf8.chr \ uppernum.chr makechr alnumspace.chr" for john_pwdfiles in $(echo ${john_pwdfiles}); do install -D -m644 run/${john_pwdfiles} \ "$subpkgdir"/usr/share/john done for john_conffiles in $(echo ${john_conffiles}); do install -D -m644 run/${john_conffiles} \ "$subpkgdir"/usr/share/john done for john_chrfiles in $(echo ${john_chrfiles}); do install -D -m644 run/${john_chrfiles} \ "$subpkgdir"/usr/share/john done } bashcomp() { depends="" pkgdesc="Bash completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" arch="noarch" cd "$builddir" install -Dm644 run/john.bash_completion \ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname || return 1 } zshcomp() { depends="" pkgdesc="Zsh completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel zsh" arch="noarch" cd "$builddir" install -Dm644 run/john.zsh_completion \ "$subpkgdir"/usr/share/zsh/site-functions/$pkgname || return 1 } md5sums="2e80ec877e78d0c6ce72febb8844e0e2 john-1.8.0.tar.gz e6e158d946783b14e1109bd96d54bb64 truecrypt_fmt_plug.patch d6ab104062b9ce84b172ad7ecdd08226 params-h.patch b1f6ab678caabf4d3adb253735f46def gcc5-support.patch" sha256sums="95bbd3ecfbe51c6263317b3009bede98f20689a26c7aee191458ed9b26d5c9f6 john-1.8.0.tar.gz 91731241b644dc8cf64d55260801277b168dcd38c5585c10120c75393f0c35fa truecrypt_fmt_plug.patch 2b2396bf9e344bb28fcf91088d5dc12b0c91de3da74a4241d32c44496a291851 params-h.patch 7abd8b061055f7c81de8cadc021050ac113f0f71a0bcfb83680f10d8ca6e04df gcc5-support.patch" sha512sums="8b7fad7a6330b5ff1afc306218ba698aaa27776b566f82c2e76102d5ceb10aeafa69d71fa6fff67c81996ea2c6a04384bab4696ed192306c6d074873562e7089 john-1.8.0.tar.gz 80be6cc1b1b35c6a85392008638b2f8b6d8a518ee35f59405e2f5682e025e4b8beecf964148311e6f62d76b59153f04427024fa81aaf56ee2062ac2dbf0a9bcb truecrypt_fmt_plug.patch a5c22feb8bf11509c306a2f236f2bd4891fdfc3b01882f07d85015e0895d82f28df0dff78ba8d3a3862d8d95877a88a9eb8138e6c407b40881fa1455079b98fc params-h.patch 4ebe8b41b1d0c3839348dcf5348332f9d7ce25919077fa054db64b7106150f299c6b177d117f7c18c1db672a494a6de6be8b5afe502f5ca3639602ba3aef6866 gcc5-support.patch"