#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto
include /usr/share/dpkg/pkg-info.mk

# the sources have no .git: the version shown by the game is given to meson
MESON_OPTS = -Dstaticdeps=false \
	-Dtrx_version=$(DEB_VERSION_UPSTREAM) \
	-Dlua_dep=lua5.4

%:
	dh $@ --buildsystem=meson --sourcedirectory=src --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure -- $(MESON_OPTS)

# the executable is installed by debian/trx.install
override_dh_auto_install:

override_dh_auto_test:

override_dh_installchangelogs-arch:
	dh_installchangelogs -a docs/CHANGELOG.md

override_dh_installchangelogs-indep:
	dh_installchangelogs -i

override_dh_fixperms-indep:
	dh_fixperms -i
	find debian/trx-data/usr/share/games/trx -type f -exec chmod 0644 {} +
