#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_DOWNLOAD_URL = https://github.com/zdohnal/system-config-printer/releases/download/$(DEB_UPSTREAM_VERSION)/$(GNOME_TARBALL)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs -Wl,--as-needed

%:
# We need to force the build system to autoconf otherwise for some reasons it
# tries to run the python_distutils one
	dh $@ --buildsystem=autoconf --with gnome,python3

override_dh_auto_configure:
	dh_auto_configure -- --with-udev-rules \
		             --with-udevdir=/lib/udev \
		             --with-systemdsystemunitdir=/lib/systemd/system

override_dh_python3:
	dh_python3 -ppython3-cupshelpers
	dh_python3 -psystem-config-printer /usr/share/system-config-printer/
	dh_python3 -psystem-config-printer-common /usr/share/system-config-printer/

override_dh_installdocs:
	dh_installdocs -A AUTHORS

override_dh_autoreconf:
	dh_autoreconf ./bootstrap

override_dh_clean:
	dh_clean -O--buildsystem=autoconf
	rm -f dbus/org.fedoraproject.Config.Printing.service
