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

PKGDIR=debian/pat

%:
	dh $@

clean:
	dh_clean
	rm -rf $(PKGDIR)

build:
	./make.bash

binary-arch: clean build
	dh_prep
	dh_installdirs

	mkdir -p $(PKGDIR)/usr/bin
	mkdir -p $(PKGDIR)/usr/share/pat
	mkdir -p $(PKGDIR)/lib/systemd/system

	mv ./pat $(PKGDIR)/usr/bin/
	cp -r share/* $(PKGDIR)/usr/share/pat/
	cp debian/pat@.service $(PKGDIR)/lib/systemd/system/

	dh_installman
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch

