#!/usr/bin/make -f

tmp := $(CURDIR)/debian/tmp
docdir := $(tmp)/usr/share/doc/debathena-zephyr-config

build:

binary: binary-arch binary-indep

binary-arch: build

binary-indep: build
	test -f debian/rules
	test "`id -u`" -eq 0
	rm -rf $(tmp)

	install -m =rwx -d $(tmp)/DEBIAN $(docdir)
	install -p -m =rwx debian/prerm debian/postinst $(tmp)/DEBIAN/
	install -p -m =rw debian/conffiles $(tmp)/DEBIAN/
	cp -a files/* $(tmp)/
	gzip -c9 debian/changelog > $(docdir)/changelog.gz
	install -p -m =rw debian/copyright $(docdir)/
	chown -R root:root $(tmp) && chmod -R go=rX $(tmp)

	dpkg-gencontrol -isp
	dpkg --build $(tmp) ..

clean:
	rm -rf $(tmp) debian/files
