Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4
5 BUILDDIR := _build
6 PKG := github.com/etix/mirrorbits
7
8 GO_LDFLAGS += -X $(PKG)/core.VERSION=v$(DEB_VERSION_UPSTREAM)
9 GO_LDFLAGS += -X $(PKG)/core.BUILD=$(DEB_VERSION)
10 GO_LDFLAGS += -X $(PKG)/config.TEMPLATES_PATH=/usr/share/mirrorbits/templates/
11 ifeq (,$(filter $(DEB_BUILD_ARCH), mipsel mips64el))
12 GO_BUILDFLAGS += -buildmode=pie
13 endif
14
15 %:
16 dh $@ --builddirectory=$(BUILDDIR) --buildsystem=golang --with=bash-completion
17
18 execute_after_dh_auto_configure:
19 # Regenerate code
20 cd $(BUILDDIR)/src/$(PKG) && \
21 find -name "*.pb.go" -delete -printf "removed %p\n" && \
22 protoc -I rpc --go_opt=paths=source_relative --go_out=plugins=grpc:rpc rpc.proto
23 # Copy vendored packages
24 cp -a debian/vendor $(BUILDDIR)/src/$(PKG)/
25
26 override_dh_auto_build:
27 dh_auto_build -- $(GO_BUILDFLAGS) -ldflags '$(GO_LDFLAGS)'
28
29 override_dh_auto_test:
30 dh_auto_test -- -ldflags '$(GO_LDFLAGS)'
31
32 override_dh_auto_install:
33 dh_auto_install -- --no-source
34 # the below step is automatic with debhelper >= 14
35 dh_installsysusers
36
37 override_dh_installsystemd:
38 dh_installsystemd --no-enable --no-start