#!/usr/bin/make -f

export DH_GOPKG = git.autistici.org/ale/autoradio
export DH_GOLANG_EXCLUDES = vendor

DESTDIR = debian/autoradio-server

%:
	dh $@ --with systemd --with golang --buildsystem golang

override_dh_auto_install:
	dh_auto_install
	$(RM) -rv $(DESTDIR)/usr/share/gocode

	# Icecast2 status XSL template.
	install -d -m 755 -o root -g root $(DESTDIR)/usr/share/icecast2/web
	install -m 644 -o root -g root $(CURDIR)/debian/status.xsl \
		$(DESTDIR)/usr/share/icecast2/web/status-autoradio.xsl

override_dh_installinit:
	dh_installinit --name=autoradio

override_dh_systemd_enable:
	dh_systemd_enable --name=radiod
	dh_systemd_enable --name=transcoderd