# Template file for 'afew'
pkgname=afew
version=4.0.1
revision=1
build_style=python3-pep517
hostmakedepends="python3-setuptools_scm python3-Sphinx pkg-config"
depends="python3-notmuch2 python3-dkimpy python3-chardet notmuch"
checkdepends="python3-pytest python3-freezegun $depends"
short_desc="Initial tagging script for notmuch mail"
maintainer="Alexander Gehrke <void@qwertyuiop.de>"
license="ISC"
homepage="https://github.com/afewmail/afew"
changelog="https://raw.githubusercontent.com/afewmail/afew/refs/heads/master/NEWS.md"
distfiles="${PYPI_SITE}/a/afew/afew-${version}.tar.gz"
checksum=2cf2920f868c01112d7f963803da1ae9287996ffeeb8ba5a99c3f7e5206003f3

export SETUPTOOLS_SCM_PRETEND_VERSION=${version}

post_build() {
	mkdir -p build/sphinx/man
	python3 -m sphinx -b man docs build/sphinx/man
}

post_install() {
	cat > ${DESTDIR}/${py3_sitelib}/afew/version.py <<-EOF
	version = "${version}"
	EOF
	vlicense LICENSE
	vman build/sphinx/man/afew.1
}
