File: rules

package info (click to toggle)
mtail 3.0.0~rc43-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,336 kB
  • sloc: yacc: 576; makefile: 217; sh: 123; lisp: 77; awk: 17
file content (43 lines) | stat: -rwxr-xr-x 1,303 bytes parent folder | download
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
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

#export DH_VERBOSE=1
export DH_GOPKG := github.com/google/mtail
export DH_GOLANG_EXCLUDES := $(DH_GOPKG)/cmd/mgen $(DH_GOPKG)/cmd/mdot
export DH_GOLANG_INSTALL_EXTRA := examples/ \
    internal/mtail/golden/ internal/mtail/testdata/ \
    internal/vm/parser/parser.y
# Build parser.go
export DH_GOLANG_GO_GENERATE := 1

BUILDDIR := $(CURDIR)/build
BUILDFLAGS = -ldflags \
  " -X main.Version=$(DEB_VERSION_UPSTREAM)\
    -X main.Revision=$(DEB_VERSION)"

%:
	dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR)

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_HOST_ARCH_BITS),64)
	dh_auto_test
else
	# soft fail on non 64-bit architectures:
	# https://github.com/google/mtail/issues/313
	dh_auto_test || echo "W: ignoring known test failure on 32-bit architectures"
endif
	# Only run race tests on amd64.
	test "$(DEB_HOST_ARCH_CPU)" != amd64 || \
            GOCACHE=$(BUILDDIR) GO111MODULE=off GOPROXY=off GOPATH=$(BUILDDIR) go test -v -timeout 5m -race -tags=integration \
                $(DH_GOPKG)/...
endif

override_dh_installinit:
	dh_installinit --no-enable --no-start

override_dh_auto_install:
	dh_auto_install -- --no-source