File: rules

package info (click to toggle)
golang-github-containers-toolbox 0.0.99.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,616 kB
  • sloc: sh: 3,195; ansic: 40; makefile: 36; python: 33
file content (52 lines) | stat: -rwxr-xr-x 1,571 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
50
51
52
#!/usr/bin/make -f

PKGNAME=podman-toolbox
GOPKG=github.com/containers/toolbox
GOPATH_TMP=$(CURDIR)/debian/tmp
GOPATH_BUNDLED_VENDOR=$(CURDIR)/debian/gocode
GOPATH_PKG_DESTDIR=$(GOPATH_TMP)/src/$(GOPKG)

# Only search for modules under GOPATH and vendor directories
export GO111MODULE=off
export GOPATH=$(CURDIR):$(GOPATH_TMP):$(GOPATH_BUNDLED_VENDOR):/usr/share/gocode
export GOCACHE=$(GOPATH_TMP)/go-build

%:
	dh $@ --buildsystem=meson

override_dh_auto_configure:
	# Create links to the internal modules under a dir (in GOPATH)
	# named after the exported package name. This is needed to
	# satisfy `go build` when GO111MODULE=off is set
	mkdir -p "$(GOPATH_PKG_DESTDIR)" && \
		cd "$(CURDIR)/src" && \
		find . -mindepth 2 -name '*.go' ! \
			-path "./vendor/*" ! \
			-path "./github.com/containers/toolbox/*" ! \
			-iname '.*' | cut -d'/' -f2 | uniq | \
			xargs -I '{}' ln -sf "$(CURDIR)/src/{}" "$(GOPATH_PKG_DESTDIR)/{}"
	dh_auto_configure -- --buildtype=plain -Dprofile_dir=/etc/profile.d \
		-Dfish_completions_dir=/usr/share/fish/vendor_completions.d

ifeq ($(FAKEROOTKEY),)
override_dh_auto_build:
	fakeroot dh_auto_build
endif

override_dh_auto_install:
	dh_auto_install
	# Do not install tests
	rm -rf $(CURDIR)/debian/$(PKGNAME)/usr/share/toolbox/test

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(GOPATH_TMP)

execute_after_dh_shlibdeps:
	echo toolbx:Depends=$(shell dpkg-query -f='$${Package}\n' -W 'libsubid[0-9]*' | uniq | sort -nr | head -n1) >> debian/podman-toolbox.substvars

override_dh_dwz:
	-dh_dwz

override_dh_auto_test:
	-dh_auto_test