#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk # for DEB_HOST_GNU_TYPE

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure --               \
		-DCMAKE_BUILD_TYPE=Release \
		-DAMPL=OFF                 \
		-DSYM=nauty                \
		-DZIMPL=ON

execute_after_dh_auto_build-indep:
	cd obj-$(DEB_HOST_GNU_TYPE) && $(MAKE) doc

execute_before_dh_installman: debian/scip.1

debian/scip.1:
	help2man -N -o $@ -n "Solving Constraint Integer Programs" \
		debian/tmp/usr/bin/scip
	sed -i '/^invalid parameter <\\-\\-help>$$/ { N; /\n\.PP$$/d }' $@
	sed -i 's|debian/tmp/usr/bin/||' $@

override_dh_auto_test:
	cd obj-$(DEB_HOST_GNU_TYPE) && $(MAKE) check
