#!/usr/bin/make -f

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS := hardening=+all

include /usr/share/dpkg/pkg-info.mk
VERSION_UPSTREAM = $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -e 's/\+[^+]*//')
export SETUPTOOLS_SCM_PRETEND_VERSION = $(VERSION_UPSTREAM)

export XFLAGS=$(shell dpkg-buildflags --get CFLAGS; dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get LDFLAGS)

%:
	dh $@ --buildsystem=none

override_dh_auto_configure:

override_dh_auto_build:
	mkdir -p c/build_all/
	cd c && ./buildalllinux.sh

override_dh_auto_install:
	install -d debian/tmp/usr/bin
	( echo "#!/usr/bin/python3"; cat python/afdko/otf2otc.py ) > debian/tmp/usr/bin/otf2otc
	chmod +x debian/tmp/usr/bin/otf2otc

override_dh_auto_test:

override_dh_auto_clean:
	rm -fr c/build_all
	-dh_auto_clean
