#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh ${@} --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --enable-debug --enable-gtk-doc --enable-udisks --disable-silent-rules

override_dh_auto_install:
	dh_auto_install

	# removing unused files
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.a
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la

override_dh_builddeb:
	dh_builddeb -- -Zxz -z9

override_dh_install:
	dh_install --fail-missing

override_dh_makeshlibs:
	# modules are not shared libs so disable processing for them
	dh_makeshlibs -X/modules/

override_dh_strip:
	dh_strip -plibfm4 -plibfm-extra4 --dbg-package=libfm-dbg
	dh_strip -plibfm-gtk4 --dbg-package=libfm-gtk-dbg
	dh_strip -plibfm-modules --dbg-package=libfm-modules-dbg
	dh_strip -plxshortcut --dbg-package=lxshortcut-dbg
	dh_strip -Nlibfm4 -Nlibfm-extra4 -Nlibfm-gtk4 -Nlibfm-modules -Nlxshortcut

override_dh_installdocs:
	dh_installdocs --link-doc=libfm4
