#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with gir

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=/usr/lib \
		--enable-bcache \
		--enable-btrfs \
		--enable-lvm2 \
		--enable-lvmcache \
		--enable-vdo \
		--enable-zram \
		--enable-gtk-doc \
		--enable-fhs-media \
		--with-systemdsystemunitdir=/lib/systemd/system

override_dh_auto_build:
	dh_auto_build
	# make -C po udisks.pot

override_dh_auto_install:
	dh_auto_install
	# install Apport hook on Ubuntu
	if dpkg-vendor --is ubuntu; then \
	    install -m 644 -D debian/local/apport-hook.py debian/udisks2/usr/share/apport/package-hooks/udisks2.py; \
	fi

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	find debian/tmp -name 'libudisks2_*.a' -print -delete
	dh_install

override_dh_missing:
	dh_missing --fail-missing

# Ubuntu is hesitant about exfat-utils in default install
# https://launchpad.net/bugs/1649537
override_dh_gencontrol:
ifneq ($(shell dpkg-vendor --query vendor),Ubuntu)
	dh_gencontrol -- -Vexfat:Recommends='exfat-utils'
else
	dh_gencontrol -- -Vexfat:Suggests='exfat-utils'
endif