#!/usr/bin/make -f

# DH_VERBOSE := 1

DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with python2 --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --with-libmuscle=/usr/include/libMUSCLE-3.7

override_dh_auto_install:
	dh_auto_install
	# The actual user interface is the Python script so move the binary to /usr/lib
	mkdir -p debian/$(DEBPKGNAME)/usr/lib/$(DEBPKGNAME)
	mv debian/$(DEBPKGNAME)/usr/bin/$(DEBPKGNAME) debian/$(DEBPKGNAME)/usr/lib/$(DEBPKGNAME)

override_dh_fixperms:
	dh_fixperms
	chmod -x debian/$(DEBPKGNAME)/usr/share/$(DEBPKGNAME)/template.ini
