#!/usr/bin/make -f

# get back current tag release notes from GitHub
mkrelease:
	quilt push changelog.patch
	debian/lib/gen_changelog.sh
	dos2unix changelog
	quilt refresh
	quilt pop -a
	@echo
	@echo This target is made to fail intentionally, to make sure
	@echo that it is NEVER run during the automated build. Please
	@echo ignore the following error, the changelog file has been
	@echo generated SUCCESSFULLY.
	@echo
	exit 1
	
mkman:
	go-md2man -in debian/backdoor-factory.1.md -out debian/backdoor-factory.1
	@echo
	@echo This target is made to fail intentionally, to make sure
	@echo that it is NEVER run during the automated build. Please
	@echo ignore the following error, the changelog file has been
	@echo generated SUCCESSFULLY.
	@echo
	exit 1

# using pybuild for install
# backdoor.py is properly named backdoor-factory
# pyc and egg-info files are cleaned
override_dh_install:
	dh_install
	mv $(CURDIR)/debian/backdoor-factory/usr/bin/backdoor.py $(CURDIR)/debian/backdoor-factory/usr/bin/backdoor-factory

%:
	dh $@ --with python3 --buildsystem=pybuild
