#!/usr/bin/make -f
# -*- makefile -*-

# this name is just too long
AIF=arno-iptables-firewall

clean:
	dh_testdir
	dh_testroot
	debconf-updatepo
	dh_clean

	rm -f $(CURDIR)/debian/init.d

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# install debconf template
	cp $(CURDIR)/debian/$(AIF).debconf \
			$(CURDIR)/debian/$(AIF)/usr/share/$(AIF)/debconf.template
	# install lintian override
	cp $(CURDIR)/debian/lintian.overrides \
			$(CURDIR)/debian/$(AIF)/usr/share/lintian/overrides/$(AIF)
	# install rsyslog configuration
	cp $(CURDIR)/debian/rsyslog.d.conf \
			$(CURDIR)/debian/$(AIF)/etc/rsyslog.d/arno-iptables-firewall.conf
	# and corresponding logrotate configuration
	cp $(CURDIR)/debian/logrotate.d.conf \
			$(CURDIR)/debian/$(AIF)/etc/logrotate.d/arno-iptables-firewall.conf

build:
# Does nothing

# Build architecture-independent files here.
binary-indep: install
	dh_testdir
	dh_testroot
	dh_install
	# fix up and remove plugin changelogs
	-rm $(CURDIR)/debian/$(AIF)/usr/share/$(AIF)/plugins/*.CHANGELOG
	dh_installchangelogs CHANGELOG
	dh_installdocs
	dh_installexamples
	dh_installdebconf
	# since one cannot know whether the firewall is
	# properly configured it must not be started
	dh_installinit --noscripts
	dh_installman
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch:
# nothing to do

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
