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
|