| 1 |
#!/usr/bin/make -f |
| 2 |
include /usr/share/dpkg/architecture.mk |
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
include /usr/share/dpkg/vendor.mk |
| 5 |
|
| 6 |
#export DH_VERBOSE=1 |
| 7 |
export DH_GOPKG := github.com/jaqx0r/mtail |
| 8 |
export DH_GOLANG_EXCLUDES := $(DH_GOPKG)/cmd/mgen $(DH_GOPKG)/cmd/mdot |
| 9 |
export DH_GOLANG_INSTALL_EXTRA := examples/ \ |
| 10 |
internal/mtail/golden/ internal/mtail/testdata/ \ |
| 11 |
internal/runtime/compiler/parser/parser.y \ |
| 12 |
internal/mtail/logo.ico |
| 13 |
# Build parser.go |
| 14 |
export DH_GOLANG_GO_GENERATE := 1 |
| 15 |
|
| 16 |
BUILDDIR := $(CURDIR)/build |
| 17 |
BUILDFLAGS = -ldflags \ |
| 18 |
" -X main.Version=$(DEB_VERSION_UPSTREAM)\ |
| 19 |
-X main.Revision=$(DEB_VERSION)\ |
| 20 |
-X main.Branch=$(DEB_VENDOR)/$(DEB_DISTRIBUTION)" |
| 21 |
|
| 22 |
TEST_TIMEOUT := 100s |
| 23 |
TESTRACE_TIMEOUT := 20m |
| 24 |
|
| 25 |
%: |
| 26 |
dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR) |
| 27 |
|
| 28 |
override_dh_auto_build: |
| 29 |
dh_auto_build -- $(BUILDFLAGS) |
| 30 |
|
| 31 |
# Use longer internal timeouts. |
| 32 |
override_dh_auto_test: export CI = true |
| 33 |
override_dh_auto_test: |
| 34 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 35 |
dh_auto_test -- -timeout $(TEST_TIMEOUT) |
| 36 |
# Only run race tests on amd64. |
| 37 |
test "$(DEB_HOST_ARCH_CPU)" != amd64 || \ |
| 38 |
dh_auto_test -- -timeout $(TESTRACE_TIMEOUT) -race -tags=integration |
| 39 |
endif |
| 40 |
|
| 41 |
override_dh_installinit: |
| 42 |
dh_installinit --no-enable --no-start --restart-after-upgrade |
| 43 |
|
| 44 |
override_dh_installsystemd: |
| 45 |
dh_installsystemd --no-enable --no-start --restart-after-upgrade |
| 46 |
|
| 47 |
override_dh_auto_install: |
| 48 |
dh_auto_install -- --no-source |