File: rules

package info (click to toggle)
prometheus-apache-exporter 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 264 kB
  • sloc: sh: 52; makefile: 32
file content (31 lines) | stat: -rwxr-xr-x 1,023 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
29
30
31
#!/usr/bin/make -f
# -*- Mode: makefile -*-
include /usr/share/dpkg/pkg-info.mk

BUILDDIR := $(CURDIR)/build
METAPKG := github.com/prometheus/common

# Taken and modified from the project's Makefile.

BRANCH     := debian/sid
USER       := team+pkg-go@tracker.debian.org
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/')
BUILDFLAGS  = -ldflags \
  " -X $(METAPKG)/version.Version=$(DEB_VERSION_UPSTREAM)\
    -X $(METAPKG)/version.Revision=$(DEB_VERSION)\
    -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 --builddir=$(BUILDDIR)

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)

override_dh_auto_install:
	install -m755 $(BUILDDIR)/bin/apache_exporter \
            debian/prometheus-apache-exporter/usr/bin/prometheus-apache-exporter