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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
PKG := github.com/containerd/containerd
GO_LDFLAGS += -X $(PKG)/version.Version=$(DEB_VERSION_UPSTREAM)
GO_LDFLAGS += -X $(PKG)/version.Revision=$(DEB_VERSION)
EXCLUDES += cmd/protoc-gen-go-fieldpath cmd/containerd-stress
EXCLUDES += runtime/v2/example/cmd
EXCLUDES += integration
EXCLUDES += tracing/plugin
EXCLUDES += contrib/fuzz
# Exclude extra files in -dev package to make it slimmer.
EXTRA_EXCLUDES += vendor
EXTRA_EXCLUDES += $(filter-out cmd/ctr,$(wildcard cmd/*))
export DH_GOLANG_EXCLUDES := $(EXCLUDES)
%:
dh $@ --buildsystem=golang --with=golang --builddirectory=_build
execute_after_dh_auto_configure:
find _build/src/$(PKG) -name '*_fuzz.go' -print -delete
override_dh_auto_build:
dh_auto_build -- -ldflags '$(GO_LDFLAGS)'
ifeq (,$(AUTOPKGTEST_TMP))
execute_after_dh_auto_build:
mkdir -p man
make man/containerd-config.8
make man/containerd-config.toml.5
_build/bin/gen-manpages containerd.8 man
_build/bin/gen-manpages ctr.8 man
rm -vf _build/bin/gen-manpages
sed 's|/usr/local/bin|/usr/bin|' containerd.service > debian/containerd.service
mkdir -vp debian/bash-completion
install -m644 -T /usr/share/gocode/src/github.com/urfave/cli/autocomplete/bash_autocomplete \
debian/bash-completion/ctr
mkdir -vp debian/zsh-completion
sed 's|$$PROG|ctr|g' /usr/share/gocode/src/github.com/urfave/cli/autocomplete/zsh_autocomplete > \
debian/zsh-completion/_ctr
endif
override_dh_auto_install:
DH_GOLANG_EXCLUDES="$(EXCLUDES) $(EXTRA_EXCLUDES)" dh_auto_install
execute_after_dh_install-indep:
# now move the gprc api definitions to its own package
mkdir -pv debian/golang-github-containerd-containerd-api-dev/usr/share/gocode/src/github.com/containerd/containerd/
mv -v debian/golang-github-containerd-containerd-dev/usr/share/gocode/src/github.com/containerd/containerd/api \
debian/golang-github-containerd-containerd-api-dev/usr/share/gocode/src/github.com/containerd/containerd/
|