#!/usr/bin/make -f

# DH_VERBOSE := 1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export DEB_CXXFLAGS_MAINT_APPEND=$(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get CPPFLAGS)

export PYBUILD_NAME=pyosmium
export PYBUILD_SYSTEM=distutils
export PYBUILD_BEFORE_TEST=cp -r {dir}/examples {dir}/tools {build_dir}
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/examples {build_dir}/tools


export VERBOSE=1

%:
	dh $@ \
	    --buildsystem pybuild \
	    --with python3,sphinxdoc

override_dh_clean:
	dh_clean
	
	$(RM) -r doc/_build

override_dh_auto_build-indep:
	dh_auto_build --indep

	(cd doc && make html)
	(cd doc && make man)

override_dh_auto_install:
	PYBUILD_INSTALL_ARGS="--install-scripts=/usr/lib/{package}" dh_auto_install
