Revert "ship systemd services for Debian"
[re6stnet.git] / debian / common.mk
1 PACKAGE = $(shell dh_listpackages)
2 TMP = $(CURDIR)/debian/$(PACKAGE)
3
4 INIT = $(TMP)/etc/init.d
5
6 ifdef VERSION
7 define CHANGELOG
8 $(PACKAGE) ($(VERSION)) nexedi; urgency=low
9
10 -- $(shell git log -1 --pretty='%cN <%cE> %cD')
11 endef
12 export CHANGELOG
13
14 .PHONY: debian/changelog
15
16 debian/changelog:
17 echo "$$CHANGELOG" >$@
18 endif
19
20 override_dh_install:
21 make DESTDIR=$(TMP) PREFIX=/usr PYTHON=/usr/bin/python \
22 install-noinit install-ifupdown
23
24 override_dh_installinit:
25 install -d $(INIT)
26 sed 's/#NAME#/re6st-registry/; s/#DEPENDS#//; s,#DAEMON_DIR#,/usr/bin,' \
27 <debian/init.d >$(INIT)/re6st-registry
28 sed 's/#NAME#/re6stnet/; s/#DEPENDS#/re6st-registry/; s,#DAEMON_DIR#,/usr/sbin,; /^case/i\
29 cd $$CONFDIR; $$DAEMON @$$NAME.conf --test "main_interface != '\'lo\''" ||\
30 case "$$1" in start) exit 0;; restart|force-reload) set stop;; esac\
31 ' <debian/init.d >$(INIT)/re6stnet
32 for x in $(INIT)/*; \
33 do chmod +x $$x && dh_installinit --onlyscripts --name=$${x##*/}; \
34 done