#!/usr/bin/make -f

deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,)

%:
	dh $@

override_dh_auto_install:
	dh_auto_install
	install -m0644 $(CURDIR)/misc/hdapsd.service $(CURDIR)/debian/hdapsd/$(deb_systemdsystemunitdir)
	mv $(CURDIR)/debian/hdapsd/$(deb_udevdir)/rules.d/hdapsd.rules $(CURDIR)/debian/hdapsd/usr/share/doc/hdapsd/hdapsd.rules
	rm -rf $(CURDIR)/debian/hdapsd/$(deb_udevdir)

override_dh_installinit:
	dh_installinit --no-enable

override_dh_installsystemd:
	dh_installsystemd --no-enable