From 3a2ca522dff63aa5575b952f5e2b95249b190be5 Mon Sep 17 00:00:00 2001 From: Michael Lustfield Date: Mon, 17 Apr 2017 15:43:41 -0500 Subject: [PATCH] Finished getting gitea to build w/ +pie --- debian/rules | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index 8651613..b79ac9b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,19 +1,21 @@ #!/usr/bin/make -f -DEB_BUILD_HARDENING_FORTIFY = 1 -GO_LDFLAGS += -extldflags=-Wl,-z,now,-z,relro - -PACKAGES ?= $(addprefix code.gitea.io/gitea/,$(filter-out integrations,$(shell go list ./... | grep -v vendor/ | sed -n 's/^.*gitea\///p'))) +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export GO_LDFLAGS = -extldflags=-Wl,-z,now,-z,relro GOPATH ?= $(CURDIR)/obj-$(DEB_TARGET_GNU_TYPE) export GOPATH +# This removes vendor/* and integrations/ without removing integrations/*/ +# It re-creates dh-golang logic with these exceptions. +PACKAGES ?= $(addprefix code.gitea.io/gitea/,$(filter-out integrations,$(shell go list ./... | grep -v vendor/ | sed -n 's/^.*gitea\///p'))) + %: dh $@ --buildsystem=golang --with=golang override_dh_auto_build: go install -v -p 4 \ -buildmode=pie \ - -pkgdir=$(GOPATH) \ - -ldflags '-s -w $(GO_LDFLAGS)' \ + -pkgdir="$(GOPATH)" \ + -ldflags="$(GO_LDFLAGS)" \ code.gitea.io/gitea $(PACKAGES) # Tests are broken by the debian build environment