#!/usr/bin/make -f

export EXE

ifeq ($(shell dpkg-architecture -qDEB_HOST_MULTIARCH),x86_64-linux-gnu)
    EXE=dsr-rpsy-linux-64bit.lnx
endif
ifeq ($(shell dpkg-architecture -qDEB_HOST_MULTIARCH),i386-linux-gnu)
    EXE=dsr-rpsy-linux-32bit.lnx
endif
ifeq ($(shell dpkg-architecture -qDEB_HOST_MULTIARCH),arm-linux-gnueabihf)
    EXE=dsr-rpsy-raspberrypi.lnx
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure
	(cd debian/scripts; \
	  for i in *.in; do\
	  o=`basename $$i .in`;\
	  sed -e 's/@EXE@/${EXE}/g' -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' "$$i" > "$$o"; \
	  done )

override_dh_shlibdeps:
	dh_shlibdeps -- -xlibsdl1.2debian
