# Template file for 'reaver'
pkgname=reaver
version=1.4
revision=2
build_style=gnu-configure
build_wrksrc="src"
conf_files="/etc/reaver/reaver.db"
makedepends="libpcap-devel sqlite-devel"
short_desc="Brute force attack tool against Wifi Protected Setup (WPS)"
maintainer="cipr3s <cipr3s@gmx.com>"
license="GPL-2"
homepage="https://code.google.com/archive/p/reaver-wps/"
distfiles="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/${pkgname}-${version}.tar.gz"
checksum="add3050a4a05fe0ab6bfb291ee2de8e9b8a85f1e64ced93ee27a75744954b22d"

post_extract() {
	case "$XBPS_TARGET_MACHINE" in
	*-musl) find -type f -exec sed -i "{}" -e"s;u_char;unsigned char;g" \;
		;;
	esac
}

do_install() {
	# The Makefile's install target is broken (ignores destdir)
	vmkdir etc/${pkgname}
	vinstall ${pkgname}.db 644 etc/${pkgname}
	vbin wash
	vbin reaver
}
