# Contributor: Fabricio Silva <hi@fabricio.dev>
# Maintainer: Fabricio Silva <hi@fabricio.dev>
pkgname=autoremove-torrents
pkgver=1.5.5
pkgrel=0
pkgdesc="Automatically remove torrents according to your strategies."
url="https://github.com/jerrymakesjelly/autoremove-torrents"
arch="noarch"
license="MIT"
depends="
	py3-requests
	py3-yaml
	py3-ply
	py3-deluge-client
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	py3-sphinx
	py3-sphinx_rtd_theme
	"
subpackages="$pkgname-pyc $pkgname-doc"
source="https://github.com/jerrymakesjelly/autoremove-torrents/archive/$pkgver/autoremove-torrents-$pkgver.tar.gz"
options="!check" # tests needs live instance for the clients

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2

	sphinx-build -b man docs docs/build
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 docs/build/autoremove-torrents.1 \
		-t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
eaef4ee9c5aca1e7ac89ce66899f4eecd843af7d3be93bd2d4b13b0f5909a73c7299b94e49273d43dd0fb713ca41366a027be9b67acfa19d776c8cdbd2bbfeac  autoremove-torrents-1.5.5.tar.gz
"
