#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem cmake --with python3

override_dh_autoreconf:

override_dh_auto_configure:
	dh_auto_configure
	sed -i -e "s@##DEB_HOST_MULTIARCH##@$(DEB_HOST_MULTIARCH)@g" \
		debian/libsymspg1.install \
		debian/libsymspg-dev.install

override_dh_auto_install:
	dh_auto_install
	(cd python; python3 setup.py install --root ../debian/python3-spglib)

override_dh_auto_test:

override_dh_makeshlibs:
	dh_makeshlibs
	sed -i 's/-[0-9]*$$//' debian/libsymspg1/DEBIAN/symbols

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_auto_clean:
	dh_auto_clean
	rm -rf python/build python/spglib.egg-info
