#!/usr/bin/make -f

export PYBUILD_NAME=autoflake
export PYBUILD_TEST_PYTEST=1

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build --buildsystem=pybuild
	python3 $(CURDIR)/debian/build_manpage.py > debian/autoflake.1

override_dh_auto_install:
	dh_auto_install --buildsystem=pybuild
	rm -r $(CURDIR)/debian/autoflake/usr/lib/*/dist-packages/*/licenses
	rm $(CURDIR)/debian/autoflake/usr/lib/*/dist-packages/LICENSE
	rm $(CURDIR)/debian/autoflake/usr/lib/*/dist-packages/README.md
	rm $(CURDIR)/debian/autoflake/usr/lib/*/dist-packages/test_autoflake.py
	chmod a-x ${CURDIR}/debian/autoflake/usr/lib/*/dist-packages/autoflake.py

override_dh_auto_clean:
	dh_auto_clean
	rm -rf autoflake.egg-info/ debian/autoflake.1
