File: rules

package info (click to toggle)
prometheus-sensor-exporter 0.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 128 kB
  • sloc: makefile: 21
file content (28 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download
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
#!/usr/bin/make -f

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

BRANCH := debian/sid
BUILD_DATE := $(shell date --utc --date='@$(SOURCE_DATE_EPOCH)' +%Y%m%d-%H:%M:%S)
GO_VERSION := $(shell go version | sed 's/go version \(\S*\).*/\1/')
USER := team+pkg-go@tracker.debian.org
BUILDFLAGS = -ldflags \
    "-X github.com/prometheus/common/version.Branch=$(BRANCH)\
    -X github.com/prometheus/common/version.BuildDate=$(BUILD_DATE)\
    -X github.com/prometheus/common/version.BuildUser=$(USER)\
    -X github.com/prometheus/common/version.GoVersion=$(GO_VERSION)\
    -X github.com/prometheus/common/version.Revision=$(DEB_VERSION)\
	-X github.com/prometheus/common/version.Version=$(DEB_VERSION_UPSTREAM)"

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

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)
	asciidoctor -b manpage man/prometheus-sensor-exporter.1.adoc

override_dh_auto_test:
	dh_auto_test -- $(BUILDFLAGS)

override_dh_auto_install:
	dh_auto_install -- --no-source