File: rules

package info (click to toggle)
geoipupdate 7.1.1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 432 kB
  • sloc: sh: 103; makefile: 70; perl: 51
file content (28 lines) | stat: -rwxr-xr-x 874 bytes parent folder | download | duplicates (3)
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

# Golang does not support PIE on mips
# cf. https://github.com/golang/go/issues/21222
ifeq ($(filter $(DEB_HOST_ARCH),mips mipsel mips64el),)
GO_FLAGS += -buildmode=pie
endif

# pass the right paths & version number (see upstream Makefile)
CONFFILE=/etc/GeoIP.conf
DATADIR=/var/lib/GeoIP
VERSION=$(DEB_VERSION_UPSTREAM)
GO_FLAGS += -ldflags '-X main.defaultConfigFile=$(CONFFILE) -X main.defaultDatabaseDirectory=$(DATADIR) -X "main.version=$(VERSION)"'

%:
	dh $@ --builddirectory=build --buildsystem=golang

override_dh_auto_build:
	dh_auto_build --builddirectory=build --buildsystem=golang -- $(GO_FLAGS)
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	# build the manpages
	CONFFILE=$(CONFFILE) DATADIR=$(DATADIR) make data
endif

override_dh_auto_install:
	dh_auto_install -- --no-source