#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME=aptly
# Package has no tests.
export PYBUILD_DISABLE=test

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build:
	# Generate man page
	PYTHONPATH=. help2man -n "tool for easy creation of Aptly multi component publishes" \
			--version-string=$(DEB_VERSION) "python3 aptly/publisher/__main__.py" \
		| sed -e s,__main__.py,aptly-publisher,g -e s,__MAIN__.PY,APTLY-PUBLISHER,g \
		> debian/aptly-publisher.1

execute_after_dh_install:
	mkdir -p debian/aptly-publisher/usr
	mv debian/python3-aptly/usr/bin debian/aptly-publisher/usr/
