File: rules

package info (click to toggle)
prometheus-pushgateway 0.3.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,272 kB
  • ctags: 333
  • sloc: makefile: 75; sh: 64
file content (41 lines) | stat: -rwxr-xr-x 1,421 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_GOPKG := github.com/prometheus/pushgateway

BUILDDIR := build
METAPKG := github.com/prometheus/common

DEBVERS    ?= $(shell dpkg-parsechangelog -SVersion)
VERSION    ?= $(shell echo '$(DEBVERS)' | sed 's/^[[:digit:]]*://; s/[-].*//')
DEBPKGNAME ?= $(shell dpkg-parsechangelog -SSource)
DEBDATE    ?= $(shell dpkg-parsechangelog -SDate)
REV        := $(DEBVERS)
BRANCH     := debian/sid
USER       := pkg-go-maintainers@lists.alioth.debian.org
HOSTNAME   := debian
BUILD_DATE := $(shell date --utc --date='$(DEBDATE)' +%Y%m%d-%H:%M:%S)
GO_VERSION := $(shell go version | sed 's/go version \(\S*\).*/\1/')
BUILDFLAGS := -ldflags \
  " -X $(METAPKG)/version.Version=$(VERSION)\
    -X $(METAPKG)/version.Revision=$(REV)\
    -X $(METAPKG)/version.Branch=$(BRANCH)\
    -X $(METAPKG)/version.BuildUser=$(USER)\
    -X $(METAPKG)/version.BuildDate=$(BUILD_DATE)\
    -X $(METAPKG)/version.GoVersion=$(GO_VERSION)"

%:
	dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR)

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)

override_dh_auto_install:
	cp -v $(BUILDDIR)/bin/pushgateway \
	    debian/$(DEBPKGNAME)/usr/bin/$(DEBPKGNAME)

gen-orig-tgz:
	if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.gz ] ; then \
	    git archive --format=tar.gz --prefix=$(DEBPKGNAME)-$(VERSION)/ \
		upstream/$(VERSION) >../$(DEBPKGNAME)_$(VERSION).orig.tar.gz; \
	fi