File: rules

package info (click to toggle)
podman 5.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,824 kB
  • sloc: sh: 4,700; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (120 lines) | stat: -rwxr-xr-x 4,558 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/vendor.mk

# cf. https://wiki.debian.org/ToolChain/LTO and https://github.com/golang/go/issues/45275
export DEB_BUILD_MAINT_OPTIONS=optimize=-lto

export GO111MODULE=off

export DH_GOLANG_GO_GENERATE := 1

export DH_GOLANG_INSTALL_EXTRA := test/e2e/testdata pkg/trust/testdata pkg/machine/compression/testdata

export DH_GOLANG_EXCLUDES := \
	contrib/perftest \
	dependencies \
	hack/podman-registry-go \
	cmd/podman/machine \
	pkg/bindings/test \
	podman/pkg/machine/e2e \
	test/e2e \
	test/endpoint \
	test/framework \
	test/goecho \
	test/testvol \
	test/utils \
	test/version

# machine/qemu only works on amd64, arm64
# set default build target explicitly, rely on dependencies
export DH_GOLANG_BUILDPKG := \
	github.com/containers/podman/cmd/podman \
	github.com/containers/podman/cmd/rootlessport \
	github.com/containers/podman/cmd/quadlet

export DH_GOLANG_TEST_EXCLUDES := $(DH_GOLANG_EXCLUDES) \
	hack \
	lock/file \
	pkg/bindings \
	pkg/machine \
	podman/cmd/podman/common

## https://podman.io/getting-started/installation#build-tags
BUILDTAGS = apparmor seccomp selinux systemd libsubid
BUILDTAGS_REMOTE = remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp

%:
	dh $@ --buildsystem=golang --with=golang,bash-completion --builddirectory=_output

execute_after_dh_auto_clean:
	# this is in addition to the golang cleanups, and cleans up docs among
	# other things. Use bash, as there is a $(<.gitignore) bashism in there.
	$(MAKE) clean SHELL=/bin/bash

execute_after_dh_auto_configure:
	# install extra source
	install -Dv -t _output/src/github.com/containers/podman/vendor/k8s.io/kubernetes/third_party/forked/golang/expansion debian/expand.go

override_dh_auto_build:
	DH_GOLANG_BUILDPKG="github.com/containers/podman/cmd/podman-testing" \
	dh_auto_build -v  --builddirectory=_output
	$(MAKE) docs docker-docs GOMD2MAN=/usr/bin/go-md2man
	DH_GOLANG_BUILDPKG="github.com/containers/podman/cmd/podman" \
	dh_auto_build -v  --builddirectory=_output -- -tags "$(BUILDTAGS_REMOTE)" \
          -ldflags "-X github.com/containers/podman/libpod/define.buildInfo=$(SOURCE_DATE_EPOCH) \
                    -X github.com/containers/podman/libpod/define.buildOrigin=$(DEB_VENDOR)"
	mv _output/bin/podman _output/bin/podman-remote
	dh_auto_build -v  --builddirectory=_output -- -tags "$(BUILDTAGS)" \
          -ldflags "-X github.com/containers/podman/libpod/define.buildInfo=$(SOURCE_DATE_EPOCH) \
                    -X github.com/containers/podman/libpod/define.buildOrigin=$(DEB_VENDOR)"

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# make test binaries available where the tests expect them
	ln -sv  ../../../../bin  _output/src/github.com/containers/podman/bin
	mkdir -p -m700 $(CURDIR)/debian/tmp-home/.cache
	mkdir -p -m700 $(CURDIR)/debian/tmp-home/.config
	mkdir -p -m700 $(CURDIR)/debian/tmp-home/.local/share
	mkdir -p -m700 $(CURDIR)/debian/tmp-home/run
	env \
	  HOME=$(CURDIR)/debian/tmp-home/.cache \
	  XDG_CACHE_HOME=$(CURDIR)/debian/tmp-home/.cache \
	  XDG_CONFIG_HOME=$(CURDIR)/debian/tmp-home/.config \
	  XDG_DATA_HOME=$(CURDIR)/debian/tmp-home/.local/share \
	  XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp-home/run \
	  PATH="$(CURDIR)/_output/bin:$$PATH" \
	  DH_GOLANG_EXCLUDES="$${DH_GOLANG_TEST_EXCLUDES}" \
	dh_auto_test -v --max-parallel=2 -- -tags "$(BUILDTAGS)"
	rm -rf $(CURDIR)/debian/tmp-home
endif

override_dh_auto_install:
	dh_auto_install \
		--destdir=debian/tmp \
		--buildsystem=golang \
		--builddirectory=_output \
		-- \
		--no-source
	# generate and install systemd unit files, manpages, etc.
	make DESTDIR=debian/tmp PREFIX=/usr LIBDIR=/usr/lib \
		install.systemd install.docker-full install.man

execute_after_dh_installman:
	# installed in the podman-remote package instead
	rm -f --verbose $(CURDIR)/debian/podman/usr/share/man/man1/podman-remote.1*
	# avoid file conflicts with the podman-compose/docker-compose packages, cf. #1054460
	rm -f --verbose $(CURDIR)/debian/podman/usr/share/man/man1/podman-compose.1*
	rm -f --verbose $(CURDIR)/debian/podman-docker/usr/share/man/man1/docker-compose.1*
	# don't ship "dockersh": podmansh is a podman-specific function
	rm -f --verbose $(CURDIR)/debian/podman-docker/usr/share/man/man1/dockersh.1*

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

override_dh_installsystemduser:
	dh_installsystemduser --no-enable