#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

LIBPKG = libsdl-gfx1.2-5


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

#override_dh_auto_configure:
#	dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_auto_build:
	dh_auto_build
	tar -cvz --transform='s,^Test,examples,' -f debian/examples.tar.gz Test

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/examples.tar.gz

override_dh_install:
	dh_install --fail-missing -XlibSDL_gfx.la

override_dh_link:
	dh_link -p$(LIBPKG) usr/lib/$(DEB_HOST_MULTIARCH)/libSDL_gfx.so.15.9.1 \
		usr/lib/$(DEB_HOST_MULTIARCH)/libSDL_gfx.so.5
	dh_link --remaining-packages
