#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PREFIX=/usr
export USE_PULSEAUDIO=1

ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)

ifeq ($(ARCH),armhf)
#	PLATFORM=platform="armv7h neon"
	export USE_X11=1
endif

%:
	dh $@ --buildsystem=cmake --builddirectory=build

override_dh_install:
	sed '1s|^#!.*python.*$$|#!/usr/bin/python3|' \
		reicast/linux/tools/reicast-joyconfig.py > reicast/linux/tools/reicast-joyconfig
	dh_install
	cp reicast/linux/man/reicast.1 reicast/linux/man/reicast.6
	cp reicast/linux/man/reicast-joyconfig.1 reicast/linux/man/reicast-joyconfig.6
