constellation-server 1.15.1

Pluggable authoritative DNS server. Entries can be added & removed from an HTTP REST API.
#!/usr/bin/make -f

DISTRIBUTION = $(shell lsb_release -sr)
VERSION = 1.15.1
PACKAGEVERSION = $(VERSION)-0~$(DISTRIBUTION)0
URL = https://github.com/valeriansaliou/constellation/releases/download/v$(VERSION)/

%:
		dh $@ --with systemd

override_dh_auto_clean:
override_dh_auto_test:
override_dh_auto_build:
override_dh_auto_install:
		$(eval ENV_ARCH := $(shell dpkg --print-architecture))
		$(eval ENV_ISA := $(shell if [ "$(ENV_ARCH)" = "amd64" ]; then echo "x86_64"; else echo "$(ENV_ARCH)"; fi))
		$(eval ENV_TARBALL := v$(VERSION)-$(ENV_ISA).tar.gz)

		echo "Architecture: $(ENV_ARCH)"
		echo "Instruction Set: $(ENV_ISA)"
		echo "Target: $(URL)$(ENV_TARBALL)"

		wget -N --progress=dot:mega $(URL)$(ENV_TARBALL)
		tar -xf $(ENV_TARBALL)
		strip constellation/constellation
		mv constellation/config.cfg constellation/constellation.cfg
		mkdir constellation/geo/
		sed -i 's/database_path = ".\/res\/geo\/"/database_path = "\/var\/lib\/constellation\/geo\/"/g' constellation/constellation.cfg

override_dh_gencontrol:
		dh_gencontrol -- -v$(PACKAGEVERSION)