rules 926 Bytes
Newer Older
Markus Frosch's avatar
Markus Frosch committed
1
2
3
4
#!/usr/bin/make -f

#export DH_VERBOSE=1

Noah Hilverling's avatar
Noah Hilverling committed
5
export DH_GOPKG := github.com/Icinga/icingadb
Markus Frosch's avatar
Markus Frosch committed
6

Noah Hilverling's avatar
Noah Hilverling committed
7
8
export GOCACHE=on

9
10
11
12
ifneq (,$(wildcard /usr/lib/go-1.11))
    export PATH := /usr/lib/go-1.11/bin:$(PATH)
endif

Markus Frosch's avatar
Markus Frosch committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
INSTALL_DIR := install -d -m 0755
INSTALL_FILE := install -m 0644
PACKAGE_PATH := debian/icingadb

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

override_dh_auto_install:
	dh_auto_install -- --no-source
	# move binary to sbin
	$(INSTALL_DIR) $(PACKAGE_PATH)/usr/sbin
	mv $(PACKAGE_PATH)/usr/bin/icingadb $(PACKAGE_PATH)/usr/sbin/icingadb
	rmdir $(PACKAGE_PATH)/usr/bin
	# config for the daemon
	$(INSTALL_DIR) $(PACKAGE_PATH)
	$(INSTALL_DIR) $(PACKAGE_PATH)/etc/icingadb
29
	$(INSTALL_FILE) icingadb.ini $(PACKAGE_PATH)/etc/icingadb/icingadb.ini
Markus Frosch's avatar
Markus Frosch committed
30
31
32
33
34
	# systemd
	$(INSTALL_DIR) $(PACKAGE_PATH)/lib/systemd/system
	$(INSTALL_FILE) etc/icingadb.service $(PACKAGE_PATH)/lib/systemd/system/

# vi: noexpandtab ts=4 sw=4 :