#!/usr/bin/make -f

# Disable Alsa on non-Linux architectures
ifneq (linux,$(DEB_HOST_ARCH_OS))
	DEB_CONFIGURE_ALSA = -DSOUNDSYSTEM_USE_ALSA=OFF
else
	DEB_CONFIGURE_ALSA = -DSOUNDSYSTEM_USE_ALSA=ON
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_ALSA)

override_dh_auto_build:
	# This file gets regenerated.  Make sure we can end up with the
	# original copy of it in place after the clean target.
	[ -f tr/fmit_fr.ts.orig ] || cp tr/fmit_fr.ts tr/fmit_fr.ts.orig
	dh_auto_build

override_dh_auto_clean:
	dh_auto_clean
	# Restore the original version of the regenerated .ts file
	[ -f tr/fmit_fr.ts.orig ] && mv tr/fmit_fr.ts{.orig,} || true
