#!/usr/bin/make -f
SHELL+= -e

DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk

D := $(CURDIR)/debian/openbsd-inetd

clean:
	dh_testdir
	rm -f debian/.stamp-*
	rm -f inetd *.o
	dh_clean

build: build-arch build-indep
build-arch: debian/.stamp-build
build-indep: debian/.stamp-build
debian/.stamp-build:
	dh_testdir
	$(MAKE) -f Makefile.debian
	touch $@

binary-arch: checkroot build
	dh_testdir
	dh_prep

	dh_installdirs usr/sbin/ usr/share/man/man5
	dh_installdocs
	dh_installman inetd.8
	dh_installchangelogs ChangeLog
	dh_link usr/share/man/man8/inetd.8.gz \
			usr/share/man/man5/inetd.conf.5.gz
	install --mode=755 inetd $D/usr/sbin/
	dh_installinit --update-rcd-params="defaults 20"
	dh_strip
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb
	
binary:	binary-arch

binary-indep:

checkroot:
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep build build-arch build-indep clean checkroot
