# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-oletools
pkgver=0.60.2
pkgrel=0
pkgdesc="tools to analyze security characteristics of MS Office and OLE files"
url="https://www.decalage.info/python/oletools"
arch="noarch"
license="BSD-2-Clause AND MIT"
depends="python3
	py3-colorclass
	py3-easygui
	py3-msoffcrypto-tool
	py3-olefile
	py3-parsing
	py3-pcodedmp
	py3-prettytable
	py3-xxxswf
	"
# bundled dependency oledump has no setup.py
# tablestream and xglob have no upstream repo or page on declage.com
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/decalage2/oletools/archive/refs/tags/v$pkgver.tar.gz
	unbundle.patch
	"
builddir="$srcdir/oletools-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# deselected test returns unknown file type, test_xlm returns 2 instead of 3 macros
	pytest --deselect tests/oleid/test_basic.py::TestOleIDBasic::test_all --deselect tests/olevba/test_basic.py::TestOlevbaBasic::test_xlm
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
d555d329c7949ed2635813975536397b69e0f7c7e2846587bf844796c4cc988eab95aeb51abd672fdf2eb270329cd6c69ced3f8c41a28f0d8e8dc2be13e6908f  py3-oletools-0.60.2.tar.gz
a7f015fac09f36fffb971818519d7d0d87884eb80580c068f5e7460427fc713272a3a4ed78d321f65d8ad47e61966e4a9db52b50736bace3f80f44df17ec8de2  unbundle.patch
"
