#!/usr/bin/make -f

export PYTHON=/usr/bin/python3

%:
	dh $@ --with python3

override_dh_autoreconf:
	NOCONFIGURE=true dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-systemd-unitdir=/lib/systemd/system \
		--with-iptables=/sbin/iptables \
		--with-iptables-restore=/sbin/iptables-restore \
		--with-ip6tables=/sbin/ip6tables \
		--with-ip6tables-restore=/sbin/ip6tables-restore \
		--with-ebtables=/sbin/ebtables \
		--with-ebtables-restore=/sbin/ebtables-restore \
		--with-ipset=/sbin/ipset

override_dh_install:
	# Delete the symlink and let update-alternatives handle it
	rm -f debian/tmp/usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.policy
	dh_install

override_dh_missing:
	dh_missing --list-missing

override_dh_fixperms:
	dh_fixperms
	chmod 0750 debian/firewalld/etc/firewalld/
