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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
PKG := github.com/etix/mirrorbits
GO_LDFLAGS += -X $(PKG)/core.VERSION=v$(DEB_VERSION_UPSTREAM)
GO_LDFLAGS += -X $(PKG)/core.BUILD=$(DEB_VERSION)
GO_LDFLAGS += -X $(PKG)/config.TEMPLATES_PATH=/usr/share/mirrorbits/templates/
ifeq (,$(filter $(DEB_BUILD_ARCH), mipsel mips64el))
GO_BUILDFLAGS += -buildmode=pie
endif
%:
dh $@ --builddirectory=_build --buildsystem=golang --with=bash-completion
execute_after_dh_auto_configure:
cd _build/src/$(PKG) && \
find -name "*.pb.go" -delete -printf "removed %p\n" && \
protoc -I rpc --go_opt=paths=source_relative --go_out=plugins=grpc:rpc rpc.proto
override_dh_auto_build:
dh_auto_build -- $(GO_BUILDFLAGS) -ldflags '$(GO_LDFLAGS)'
override_dh_auto_test:
dh_auto_test -- -ldflags '$(GO_LDFLAGS)'
override_dh_auto_install:
dh_auto_install -- --no-source
# the below step is automatic with debhelper >= 14
dh_installsysusers
override_dh_installsystemd:
dh_installsystemd --no-enable --no-start
|