#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

progname=$(shell awk '/^Source/ {print $$2}' debian/control)
buildroot=debian/$(progname)

deproot=$(progname)/deproot
tmp=debian/tmp

%:
	if ! mount | grep -q /proc; then \
		echo "### ERROR: /proc must be mounted"; \
		exit 1; \
	fi
	dh $@

execute_before_dh_clean:
	# dh_clean will clean all other build files (in debian/tmp)
	rm -rf lib/deps

override_dh_auto_build:
	./duct-tape-deps.sh

override_dh_auto_test:
	LD_LIBRARY_PATH=/usr/lib/tklbam-pypy2/bin /usr/lib/tklbam-pypy2/bin/pypy tests/profile_hooks.py -v
	LD_LIBRARY_PATH=/usr/lib/tklbam-pypy2/bin /usr/lib/tklbam-pypy2/bin/pypy tests/restore_identity.py -v

# don't try to link libs - won't work because we build against pypy
override_dh_shlibdeps:
override_dh_makeshlibs:
