void-packages/srcpkgs/john/template
2020-03-18 16:20:06 +01:00

104 lines
2.6 KiB
Bash

# Template file for 'john'
pkgname=john
version=1.9.0
revision=1
_jumbover=1
wrksrc="${pkgname}-${version}-jumbo-${_jumbover}"
build_wrksrc="src"
build_style=gnu-configure
configure_args="--with-systemwide"
makedepends="libressl-devel gmp-devel libgomp-devel libpcap-devel bzip2-devel zlib-devel"
short_desc="John the Ripper password cracker (jumbo-${_jumbover} patch included)"
maintainer="Piraty <piraty1@inbox.ru>"
license="GPL-2.0-or-later with OpenSSL-exception"
homepage="https://www.openwall.com/john/"
distfiles="$homepage/k/$pkgname-${version}-jumbo-${_jumbover}.tar.xz"
checksum=f5d123f82983c53d8cc598e174394b074be7a77756f5fb5ed8515918c81e7f3b
# the build system checks the host cpu for features, so when building on
# a modern power9 system, it will attempt to shove in -mvsx and so on,
# which breaks builds for 970 and 32-bit
case "$XBPS_TARGET_MACHINE" in
ppc64le*) ;;
ppc*) configure_args+=" --disable-simd";;
esac
pre_configure() {
unset CPP AS LD
}
# Tests cannot be run because include statements for rules in john.conf search
# in /usr/share/john, even if $JOHN is replaced and points to
# `/builddir/john-.../run`.
do_check() {
:
}
do_install() {
# doc and license
cd ../
cp -r doc doc.tmp ; cd doc.tmp
for f in *LICENSE* COPYING; do
vlicense $f
rm $f
done
rm INSTALL*
rm -r extras
for f in * ; do
vdoc $f
done
cd .. ; rm -r doc.tmp
cd run
# binaries
vbin john
for f in SIPdump bitlocker2john calc_stat cprepair dmg2john eapmd5tojohn \
genmkvpwd hccap2john keepass2john mkvcalcproba putty2john racf2john \
raw2dyna tgtsnarf uaf2john vncpcap2john wpapcap2john ; do
vbin $f
done
# scripts
for ext in lua pl rb py; do
for f in *.$ext ; do
vbin $f ${f/.$ext}
done
done
vbin mailer john-mailer
# data
vmkdir usr/share/john
vcopy john.conf usr/share/john
vcopy rules usr/share/john
vcopy "*.chr" usr/share/john
vcopy "*.lst" usr/share/john
vcopy "*.conf" usr/share/john
vcopy "*.js" usr/share/john
vmkdir usr/share/applications
vcopy "../src/packaging/*.desktop" usr/share/applications/john.desktop
vmkdir usr/share/bash-completion/completions
vinstall john.bash_completion 644 usr/share/bash-completion/completions/ john
vmkdir usr/share/zsh/site-functions
vinstall john.zsh_completion 644 usr/share/zsh/site-functions/ _john
}
post_install() {
cd $DESTDIR
vsed -i ${DESTDIR}/usr/share/john/john.conf \
-e 's|$JOHN|/usr/share/john|g'
# fix some perms
chmod 644 $(find ${DESTDIR}/usr/share/ -type f)
cd usr/bin
ln -s john unafs
ln -s john unique
ln -s john unshadow
ln -s john undrop
ln -s john gpg2john
ln -s john rar2john
ln -s john zip2john
}