File: rules

package info (click to toggle)
abbtr 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 108 kB
  • sloc: makefile: 36
file content (49 lines) | stat: -rwxr-xr-x 1,158 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
44
45
46
47
48
49
#!/usr/bin/make -f

%:
	dh $@

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

include /usr/share/dpkg/pkg-info.mk
export GOFLAGS=-trimpath

override_dh_auto_build:
	rm -f $(CURDIR)/go.mod
	export GOCACHE=$(CURDIR)/.cache/go-build && \
	export GO111MODULE=on && \
	go mod init abbtr && \
	go mod tidy && \
	go build -trimpath -buildmode=pie -ldflags="-buildid= -X main.version=$(DEB_VERSION)" -o abbtr

override_dh_auto_install:
	mkdir -p debian/abbtr/usr/bin
	install -m 0755 abbtr debian/abbtr/usr/bin/abbtr

override_dh_auto_clean:
	dh_auto_clean
	rm -f abbtr
	rm -rf $(CURDIR)/.cache/go-build
	rm -f $(CURDIR)/go.mod

override_dh_usrlocal:
	true

override_dh_dwz:
	true

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_gencontrol:
	dh_gencontrol -- -VFStdeps=golang-go -Vmisc:Built-Using="" -Vmisc:Static-Built-Using=""

override_dh_auto_test:
	@echo "DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS)"
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	export GOCACHE=$(CURDIR)/.cache/go-build && \
	cd $(CURDIR) && go test -vet=off -v ./...
endif

override_dh_installtests:
	rsync -av --exclude='debian' $(CURDIR)/ $(CURDIR)/debian/abbtr-tests