#!/usr/bin/make -f

VERSION=$(shell dpkg-parsechangelog --show-field Version | sed 's/-[^-]*//')

export PYBUILD_NAME=python-ase

%:
	dh $@ --with python2 --buildsystem=pybuild
#	dh $@ --with python2,python3 --buildsystem=pybuild

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
		PYBUILD_TEST_ARGS="{interpreter} {dir}/setup.py test" \
		dh_auto_test

override_dh_fixperms:
	dh_fixperms
	chmod -x $(CURDIR)/debian/python-ase/usr/share/python-ase/doc/static/*

generate-manpages:
	help2man --version-string $(VERSION) -N -n "Build simple molecule or bulk structure" \
		ase-build -o $(CURDIR)/debian/man/ase-build.1
	help2man --version-string $(VERSION) -N -n "Put stuff into or query database" \
		ase-db -o $(CURDIR)/debian/man/ase-db.1
	help2man --version-string $(VERSION) -N -n "graphical user interface for ASE" \
		ase-gui -o $(CURDIR)/debian/man/ase-gui.1
	help2man --version-string $(VERSION) -N -n "Write information about files" \
		ase-info -o $(CURDIR)/debian/man/ase-info.1
	help2man --version-string $(VERSION) -N -n "Run calculations with ASE's calculators" \
		ase-run -o $(CURDIR)/debian/man/ase-run.1
