# Template file for 'binwalk'
pkgname=binwalk
version=2.4.1
revision=1
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3"
short_desc="Easy tool for analyzing/reversing/extracting firmware images"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="MIT"
homepage="https://github.com/OSPG/binwalk"
distfiles="https://github.com/OSPG/binwalk/archive/v${version}.tar.gz"
checksum=26d13afd3610b39a38a3062a34c05d94dacda3f6f6aa6d1d19e42b61fabe1c8f

post_extract() {
	vsed -i -e 's;/etc/bash_completion.d/%s;%s.bash;' setup.py

	if [ $(id -u) -eq 0 ]; then
		# CI container has different privileges than expected in tests.
		# Append " **{'run-as' : 'root'}," to "binwalk.scan(input_vector_file,".
		vsed -i -e "/binwalk.scan(input_vector_file,/ s/$/ **{'run-as' : 'root'},/" testing/tests/test_*.py
	fi
}

do_check() {
	: nose is broken
}

post_install() {
	vlicense LICENSE
}
