#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
export DEB_CFLAGS_MAINT_APPEND = $(CPPFLAGS) -Wall -Wno-deprecated-declarations -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--localedir=\$${prefix}/share/locale \
		--docdir=\$${prefix}share/doc \
		--docsubdir=dvdisaster-doc/html \
		--with-embedded-src-path=no

override_dh_auto_build-arch:
	make all

override_dh_auto_build-indep:
	make images

override_dh_auto_install-arch:
	dh_auto_install -a -- BUILDROOT=$(CURDIR)/debian/tmp

override_dh_auto_install-indep:
	make install-doc BUILDROOT=$(CURDIR)/debian/tmp

# Ensure that none of the text files that the application
# tries to display directly are not compressed, as it doesn't
# automatically decompress text files.
override_dh_compress:
	dh_compress -p dvdisaster \
		-X.CHANGELOG -XCREDITS -XREADME.MODIFYING -XTODO
	dh_compress --remaining-packages
