summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 4208018b1811b16a0d8c78afb30b5cf239e01e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/make -f

export DH_VERBOSE=1

export DH_GOLANG_BUILDPKG=github.com/icinga/icingadb/cmd/icingadb \
                          github.com/icinga/icingadb/cmd/icingadb-migrate

export GO111MODULE=on

include /usr/share/dpkg/pkg-info.mk

BUILD_DATE=$(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)")

MANPAGES := $(wildcard debian/man/*.*.xml)

%:
	dh $@ --builddirectory=_build --buildsystem=golang --with=golang

override_dh_clean:
	dh_clean debian/man/*.8

override_dh_auto_configure:
	dh_auto_configure

	(mkdir -p _build/pkg && cd _build/pkg && ln -s ../../dependencies/pkg/* .)

override_dh_auto_build:
	# Create man page from DocBook XML
	for x in $(MANPAGES) ; do \
	    docbook2x-man --string-param header-3="$(BUILD_DATE)" $$x ; \
	    mv `basename $$x | sed 's/.xml$$//'` `dirname $$x` ; \
	done

	dh_auto_build

override_dh_auto_install:
	dh_auto_install -- --no-source

	mv debian/icingadb/usr/bin debian/icingadb/usr/sbin

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

override_dh_compress:
	dh_compress -X.md