#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@ --with autoreconf

override_dh_auto_clean:
	dh_auto_clean
	rm -f src/predicates_init test/boolean/errors

override_dh_auto_configure:
	dh_auto_configure
	sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
		debian/libgts-dev.links.in > debian/libgts-dev.links

override_dh_auto_test:
	find test/ -name '*.sh' -exec chmod +x {} +
	dh_auto_test

override_dh_auto_install:
	dh_auto_install
	for file in debian/tmp/usr/lib/*/*.la; do \
		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
	done

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_strip:
	dh_strip -p libgts-0.7-5 --dbg-package=libgts-dbg
	dh_strip -s --remaining-packages
