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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
include /usr/share/dpkg/pkg-info.mk
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
DH_GOPKG := github.com/google/fscrypt
ifeq ($(filter $(DEB_HOST_ARCH),mips mipsel mips64el),)
GO_FLAGS += -buildmode=pie
endif
GO_LINK_FLAGS := -s -w
VERSION_FLAG := -X "main.version=v$(DEB_VERSION_UPSTREAM)"
GO_LINK_FLAGS += $(VERSION_FLAG) -extldflags "$(LDFLAGS)"
GO_FLAGS += --ldflags '$(GO_LINK_FLAGS)'
%:
dh $@ --buildsystem=golang --with=golang
override_dh_auto_build:
DH_GOLANG_BUILDPKG=$(DH_GOPKG)/cmd/... dh_auto_build -O--buildsystem=golang -- $(GO_FLAGS)
DH_GOLANG_BUILDPKG=$(DH_GOPKG)/pam_fscrypt/... dh_auto_build -O--buildsystem=golang -- $(GO_FLAGS) -buildmode=c-shared
ls -l obj-*/pkg/*/$(DH_GOPKG)/*.a
SOPATH=$$(dirname obj-*/pkg/*/$(DH_GOPKG)/*.a) && mv -v $$SOPATH/*.a $$SOPATH/pam_fscrypt.so
override_dh_auto_test:
DH_GOLANG_EXCLUDES="crypto filesystem" dh_auto_test
|