Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 PKGNAME=podman-toolbox
4 GOPKG=github.com/containers/toolbox
5 GOPATH_TMP=$(CURDIR)/debian/tmp
6 GOPATH_BUNDLED_VENDOR=$(CURDIR)/debian/gocode
7 GOPATH_PKG_DESTDIR=$(GOPATH_TMP)/src/$(GOPKG)
8
9 # Only search for modules under GOPATH and vendor directories
10 export GO111MODULE=off
11 export GOPATH=$(CURDIR):$(GOPATH_TMP):$(GOPATH_BUNDLED_VENDOR):/usr/share/gocode
12 export GOCACHE=$(GOPATH_TMP)/go-build
13
14 %:
15 dh $@ --buildsystem=meson
16
17 override_dh_auto_configure:
18 # Create links to the internal modules under a dir (in GOPATH)
19 # named after the exported package name. This is needed to
20 # satisfy `go build` when GO111MODULE=off is set
21 mkdir -p "$(GOPATH_PKG_DESTDIR)" && \
22 cd "$(CURDIR)/src" && \
23 find . -mindepth 2 -name '*.go' ! \
24 -path "./vendor/*" ! \
25 -path "./github.com/containers/toolbox/*" ! \
26 -iname '.*' | cut -d'/' -f2 | uniq | \
27 xargs -I '{}' ln -sf "$(CURDIR)/src/{}" "$(GOPATH_PKG_DESTDIR)/{}"
28 dh_auto_configure -- --buildtype=plain -Dprofile_dir=/etc/profile.d \
29 -Dfish_completions_dir=/usr/share/fish/vendor_completions.d
30
31 ifeq ($(FAKEROOTKEY),)
32 override_dh_auto_build:
33 fakeroot dh_auto_build
34 endif
35
36 override_dh_auto_install:
37 dh_auto_install
38 # Do not install tests
39 rm -rf $(CURDIR)/debian/$(PKGNAME)/usr/share/toolbox/test
40
41 override_dh_auto_clean:
42 dh_auto_clean
43 rm -rf $(GOPATH_TMP)
44
45 execute_after_dh_shlibdeps:
46 echo toolbx:Depends=$(shell dpkg-query -f='$${Package}\n' -W 'libsubid[0-9]*' | uniq | sort -nr | head -n1) >> debian/podman-toolbox.substvars
47
48 override_dh_dwz:
49 -dh_dwz
50
51 override_dh_auto_test:
52 -dh_auto_test