Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4
5 PKG := github.com/containerd/containerd
6 GO_LDFLAGS += -X $(PKG)/version.Version=$(DEB_VERSION_UPSTREAM)
7 GO_LDFLAGS += -X $(PKG)/version.Revision=$(DEB_VERSION)
8
9 # avoid dependencies
10 EXCLUDES += containerd-stress
11 EXCLUDES += containerd/v2/plugins
12 EXCLUDES += contrib/checkpoint
13 EXCLUDES += contrib/fuzz
14 EXCLUDES += go-buildtag
15 EXCLUDES += protoc-gen-go-fieldpath
16 EXCLUDES += runtime/v2/example/cmd
17
18 # Exclude extra files in -dev package to make it slimmer.
19 EXTRA_EXCLUDES += vendor
20
21 export DH_GOLANG_EXCLUDES := $(EXCLUDES)
22
23 %:
24 dh $@ --buildsystem=golang --builddirectory=_build
25
26 override_dh_auto_build:
27 ifeq (,$(AUTOPKGTEST_TMP))
28 # the Debian golang debhelper disables GO 1.11 modules explicitly, which
29 # prevents the "replace" statment in go.mod from working. In the upstream,
30 # build system, the code is accessed both ways to allow sharing code with
31 # the v1 codebase. cf.
32 # https://github.com/containerd/containerd/commit/2ac2b9c909fb64f4d06958a0ca2f556bec348d05
33 # The interface prototype definitions are treated as its own golang submodule that is
34 # imported without /v2 in order to make it compatible with the 1.0 API code base.
35 mv -v _build/src/github.com/containerd/containerd/v2/api _build/src/github.com/containerd/containerd/
36 endif
37 # install vendored sources
38 ln -sfr --verbose debian/vendor/ _build/src/vendor
39 dh_auto_build -- -ldflags '$(GO_LDFLAGS)'
40
41 ifeq (,$(AUTOPKGTEST_TMP))
42 execute_after_dh_auto_build:
43 mkdir -p man
44 make man/containerd-config.8
45 make man/containerd-config.toml.5
46 _build/bin/gen-manpages containerd.8 man
47 _build/bin/gen-manpages ctr.8 man
48 rm -vf _build/bin/gen-manpages
49
50 sed 's|/usr/local/bin|/usr/bin|' containerd.service > debian/containerd.service
51 mkdir -vp debian/bash-completion
52 install -m644 -T /usr/share/gocode/src/github.com/urfave/cli/autocomplete/bash_autocomplete \
53 debian/bash-completion/ctr
54 mkdir -vp debian/zsh-completion
55 sed 's|$$PROG|ctr|g' /usr/share/gocode/src/github.com/urfave/cli/autocomplete/zsh_autocomplete > \
56 debian/zsh-completion/_ctr
57 endif
58
59 override_dh_auto_install:
60 DH_GOLANG_EXCLUDES="$(EXCLUDES) $(EXTRA_EXCLUDES)" dh_auto_install
61
62 execute_after_dh_install-indep:
63 # now move the gprc api definitions to its own package
64 mkdir -pv debian/golang-github-containerd-containerd-api-dev/usr/share/gocode/src/github.com/containerd/containerd/
65 cp -vr _build/src/github.com/containerd/containerd/api \
66 debian/golang-github-containerd-containerd-api-dev/usr/share/gocode/src/github.com/containerd/containerd/
67
68 override_dh_auto_test:
69 DH_GOLANG_EXCLUDES="$(EXCLUDES) $(EXTRA_EXCLUDES) integration" dh_auto_test