| 1 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 29 |
statment |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
mv -v _build/src/github.com/containerd/containerd/v2/api _build/src/github.com/containerd/containerd/ |
| 36 |
endif |
| 37 |
|
| 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 |
|
| 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 |