#!/usr/bin/make -f

%:
	dh $@ --with python2 -Spython_distutils

override_dh_fixperms:
	chmod +x `grep '^#!' debian/ansible/usr/share/ansible/*/* -n | grep ':1:' | cut -d: -f 1`
	dh_fixperms

override_dh_auto_build:
	dh_auto_build
	# html documentation
	cp -a docsite/ docbuild
	cp debian/missing-files/*.jpg docbuild
	PYTHONPATH=../lib make docs -C docbuild
	mv docbuild/htmlout html
	cp -r docbuild/man html/
	rm -rf docbuild
	# man pages for the "man3" section
	make docs

override_dh_auto_test:
	make tests

override_dh_auto_clean:
	# sphinx auto-build stuff
	rm -rf html docs/man/man3/*.3
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md
