common.mk 787 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
PACKAGE = $(shell dh_listpackages)
TMP = $(CURDIR)/debian/$(PACKAGE)

INIT = $(TMP)/etc/init.d

ifdef VERSION
define CHANGELOG
$(PACKAGE) ($(VERSION)) nexedi; urgency=low

10
 -- $(shell git log -1 --pretty='%cN <%cE>  %cD')
11 12 13 14 15 16 17 18 19 20
endef
export CHANGELOG

.PHONY: debian/changelog

debian/changelog:
	echo "$$CHANGELOG" >$@
endif

override_dh_install:
21
	make DESTDIR=$(TMP) PREFIX=/usr PYTHON=/usr/bin/python install
22 23 24

override_dh_installinit:
	install -d $(INIT)
25
	sed 's/#NAME#/re6st-registry/; s,#DAEMON_DIR#,/usr/bin,' \
26
		<debian/init.d >$(INIT)/re6st-registry
27 28
	sed 's/#NAME#/re6stnet/; s,#DAEMON_DIR#,/usr/sbin,' \
		<debian/init.d >$(INIT)/re6stnet
29
	# -R is the default with debian/compat 10
30
	for x in $(INIT)/*; \
31
	do chmod +x $$x && dh_installinit -R --onlyscripts --name=$${x##*/}; \
32
	done