File: rules

package info (click to toggle)
prometheus-mongodb-exporter 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 388 kB
  • ctags: 294
  • sloc: sh: 62; makefile: 35
file content (24 lines) | stat: -rwxr-xr-x 816 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
#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_GOPKG := github.com/dcu/mongodb_exporter
export DH_GOLANG_INSTALL_EXTRA := collector/fixtures

BUILDDIR := build

DEBVERS    ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION    ?= $(shell echo '$(DEBVERS)' | sed 's/^[[:digit:]]*://; s/[-].*//')
DEBPKGNAME ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')

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

override_dh_auto_install:
	cp -v $(BUILDDIR)/bin/mongodb_exporter \
            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