summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2020-09-22 15:25:48 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2020-09-22 15:50:57 -0700
commit1b388199dc189202d9739c02a2fcd15741739fed (patch)
tree6801c8233943706d711054b35d2e5677dd4c1961 /app-emulation/containerd/containerd-1.4.1.ebuild
parentapp-emulation/runc: bump to 1.0.0_rc92 (diff)
downloadgentoo-1b388199dc189202d9739c02a2fcd15741739fed.tar.gz
gentoo-1b388199dc189202d9739c02a2fcd15741739fed.tar.bz2
gentoo-1b388199dc189202d9739c02a2fcd15741739fed.zip
app-emulation/containerd: bump to 1.4.1, improve ebuild
a lot of improvements, doc and manpage installation. device-mapper useflag added selinux useflag added Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'app-emulation/containerd/containerd-1.4.1.ebuild')
-rw-r--r--app-emulation/containerd/containerd-1.4.1.ebuild85
1 files changed, 85 insertions, 0 deletions
diff --git a/app-emulation/containerd/containerd-1.4.1.ebuild b/app-emulation/containerd/containerd-1.4.1.ebuild
new file mode 100644
index 000000000000..b1eae77465c4
--- /dev/null
+++ b/app-emulation/containerd/containerd-1.4.1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# update on bump
+CONTAINERD_COMMIT="c623d1b"
+EGO_PN="github.com/containerd/${PN}"
+MY_PV="${PV/_rc/-rc.}"
+
+inherit golang-vcs-snapshot toolchain-funcs
+
+DESCRIPTION="A daemon to control runC"
+HOMEPAGE="https://containerd.io/"
+SRC_URI="https://github.com/containerd/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="apparmor btrfs device-mapper +cri hardened +seccomp selinux test"
+
+# ~pinned dependencies described in vendor.conf
+DEPEND="
+ btrfs? ( sys-fs/btrfs-progs )
+ seccomp? ( sys-libs/libseccomp )
+"
+
+RDEPEND="
+ ${DEPEND}
+ ~app-emulation/runc-1.0.0_rc92
+"
+
+BDEPEND="
+ dev-go/go-md2man
+ virtual/pkgconfig
+ test? ( "${RDEPEND}" )
+"
+
+# tests require root or docker
+# upstream does not recommend stripping binary
+RESTRICT="strip test"
+
+S="${WORKDIR}/${P}/src/${EGO_PN}"
+
+src_prepare() {
+ default
+ sed -i -e "s/git describe --match.*$/echo ${PV})/"\
+ -e "s/git rev-parse HEAD.*$/echo ${CONTAINERD_COMMIT})/"\
+ -e "s/-s -w//" \
+ Makefile || die
+}
+
+src_compile() {
+ local options=(
+ $(usev apparmor)
+ $(usex btrfs "" "no_btrfs")
+ $(usex cri "" "no_cri")
+ $(usex device-mapper "" "no_devmapper")
+ $(usev seccomp)
+ $(usev selinux)
+ )
+
+ myemakeargs=(
+ BUILDTAGS="${options[*]}"
+ DESTDIR="${ED}"
+ LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '')
+ )
+
+ export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
+ export GOFLAGS="-v -x -mod=vendor"
+ emake "${myemakeargs[@]}" all man
+}
+
+src_install() {
+ dobin bin/*
+ doman man/*
+ newinitd "${FILESDIR}"/${PN}.initd-r1 "${PN}"
+ keepdir /var/lib/containerd
+
+ # we already installed manpages, remove markdown source
+ # before installing docs directory
+ rm -rf docs/man || die
+ local DOCS=( README.md PLUGINS.md docs/. )
+ einstalldocs
+}