#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/default.mk

# used in dh_install, dh_link
export ABI_VERSION=1.2.69

%:
	dh $@ -Scmake+ninja

# There are no automated tests in this package
override_dh_auto_test:

execute_after_dh_install:
	chrpath -d debian/libsdl1.2-compat-tests/usr/libexec/installed-tests/libsdl1.2-compat/checkkeys
	chrpath -d debian/libsdl1.2-compat-tests/usr/libexec/installed-tests/libsdl1.2-compat/graywin
	chrpath -d debian/libsdl1.2-compat-tests/usr/libexec/installed-tests/libsdl1.2-compat/loopwave
	chrpath -d debian/libsdl1.2-compat-tests/usr/libexec/installed-tests/libsdl1.2-compat/test*
	chrpath -d debian/libsdl1.2-compat-tests/usr/libexec/installed-tests/libsdl1.2-compat/torturethread

# debhelper >= 13.4 makes all of /usr/libexec executable, which is not
# quite right for installed-tests (#1006927)
override_dh_fixperms:
	dh_fixperms -Xusr/libexec/installed-tests
	chmod --recursive a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-tests
