From 81d86eeb077397659d79c1a46988f771c8a30051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20G=C3=A9rczei?= Date: Wed, 15 Jul 2020 09:17:24 +0200 Subject: [PATCH] bumped libpod in order to address https://github.com/containers/podman/issues/6857 --- app-emulation/libpod/Manifest | 4 + app-emulation/libpod/files/podman.initd | 17 +++ app-emulation/libpod/files/podman.logrotated | 7 + app-emulation/libpod/libpod-2.0.2.ebuild | 152 +++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 app-emulation/libpod/Manifest create mode 100644 app-emulation/libpod/files/podman.initd create mode 100644 app-emulation/libpod/files/podman.logrotated create mode 100644 app-emulation/libpod/libpod-2.0.2.ebuild diff --git a/app-emulation/libpod/Manifest b/app-emulation/libpod/Manifest new file mode 100644 index 0000000..93db38b --- /dev/null +++ b/app-emulation/libpod/Manifest @@ -0,0 +1,4 @@ +AUX podman.initd 566 BLAKE2B ccfedaea85b03a09446b678460d53591e62a9d8a1c205bd850fd95b4ce0ed47ebf767830fb9d30d32f1c0a4a1868eeb83c2c7deaef1617c0e6e91899807f0c36 SHA512 561c72d71827e523ab177b38961e38a594a14da8c6f0490d5743f35f4d02f4d813b43d9b3a66dd1aa72701c7d9a88ac6bb3a8435e72afcfa23289cce460bdb04 +AUX podman.logrotated 85 BLAKE2B 730899f93ee354e476629276b69224cfeaaa1603b6690cac3c0cd905cd75add19179f99e26f29edbd963d5f44c38a3a2db0b5a3613dc665ab801654eac13dc2e SHA512 0136d063b15b07c41a9370ba1845c4f368ec46a7a30683b7ff7cbb0b12e5b2711c9a45329f5102af6a969e562edcec006a8de9055e43e1caf9395847d0c5ec45 +DIST libpod-2.0.2.tar.gz 9192157 BLAKE2B b8635ea5b166082be03a041f74d6c7a5c8bed04131b039ba505f87240a1a2e4503a3dc14c037eeb41955ff7f949dc0978571ec63f011adb9e5a6efa1157b6bce SHA512 5bcdca28021c8b36b5689e69c00232ca20404af0903ea632cea350ecf6b6eed091260f1b8fea8fe6d06caa7a475ba87ef4f3e86e83807ffdd187f9ccc41cb194 +EBUILD libpod-2.0.2.ebuild 4370 BLAKE2B c37c9f8622a757c2f2bc4080f316214eacba28d812ac745c492d0317b8ec9e0edd768ced31847f2cba19261aa076e44f1ea8bdf79f5a4b6ba9a21415f26c5f44 SHA512 4433479a3de16613796d7f0d8fdf87b2b88ec45d7cb8422704a91997b95e70f5e63757f337072dcfcb094c038ab5758e1ee855bcf0eefc4f178a33f5c441e929 diff --git a/app-emulation/libpod/files/podman.initd b/app-emulation/libpod/files/podman.initd new file mode 100644 index 0000000..b590be1 --- /dev/null +++ b/app-emulation/libpod/files/podman.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 2015-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Podman Remote API Service" +LOG_PATH="/var/log/${RC_SVCNAME}" +RUN_PATH="/run/${RC_SVCNAME}" +pidfile="${RUN_PATH}/${RC_SVCNAME}.pid" +command="/usr/bin/podman" +command_args="--log-level debug varlink -t 0 unix:/run/podman/io.podman" +command_background="true" +start_stop_daemon_args="--stdout ${LOG_PATH}/${RC_SVCNAME}.log --stderr ${LOG_PATH}/${RC_SVCNAME}.log" + +start() { + checkpath -d "${RUN_PATH}" "${LOG_PATH}" + default_start +} diff --git a/app-emulation/libpod/files/podman.logrotated b/app-emulation/libpod/files/podman.logrotated new file mode 100644 index 0000000..b9d7234 --- /dev/null +++ b/app-emulation/libpod/files/podman.logrotated @@ -0,0 +1,7 @@ +/var/log/podman/podman.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-emulation/libpod/libpod-2.0.2.ebuild b/app-emulation/libpod/libpod-2.0.2.ebuild new file mode 100644 index 0000000..8097f07 --- /dev/null +++ b/app-emulation/libpod/libpod-2.0.2.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +EGIT_COMMIT="a11c4ead10177a66ef2810a0a92ea8ce2299da07" + +inherit bash-completion-r1 flag-o-matic go-module + +DESCRIPTION="Library and podman tool for running OCI-based containers in Pods" +HOMEPAGE="https://github.com/containers/libpod/" +SRC_URI="https://github.com/containers/libpod/archive/v${PV}.tar.gz -> ${P}.tar.gz" +LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0" +SLOT="0" + +KEYWORDS="~amd64" +IUSE="apparmor btrfs +fuse +rootless selinux" +RESTRICT="test" + +COMMON_DEPEND=" + app-crypt/gpgme:= + >=app-emulation/conmon-2.0.0 + || ( >=app-emulation/runc-1.0.0_rc6 app-emulation/crun ) + dev-libs/libassuan:= + dev-libs/libgpg-error:= + >=net-misc/cni-plugins-0.8.6 + sys-fs/lvm2 + sys-libs/libseccomp:= + + apparmor? ( sys-libs/libapparmor ) + btrfs? ( sys-fs/btrfs-progs ) + rootless? ( app-emulation/slirp4netns ) + selinux? ( sys-libs/libselinux:= ) +" +DEPEND=" + ${COMMON_DEPEND} + dev-go/go-md2man" +RDEPEND="${COMMON_DEPEND} + fuse? ( sys-fs/fuse-overlayfs )" + +S=${S//work\/libpod/work\/podman} + +src_prepare() { + default + + # Disable installation of python modules here, since those are + # installed by separate ebuilds. + local makefile_sed_args=( + -e '/^GIT_.*/d' + -e 's/$(GO) build/$(GO) build -v -work -x/' + -e 's/^\(install:.*\) install\.python$/\1/' + -e 's|^pkg/varlink/iopodman.go: .gopathok pkg/varlink/io.podman.varlink$|pkg/varlink/iopodman.go: pkg/varlink/io.podman.varlink|' + ) + + has_version -b '>=dev-lang/go-1.13.9' || makefile_sed_args+=(-e 's:GO111MODULE=off:GO111MODULE=on:') + + sed "${makefile_sed_args[@]}" -i Makefile || die + + sed -e 's|OUTPUT="${CIRRUS_TAG:.*|OUTPUT='v${PV}'|' \ + -i hack/get_release_info.sh || die +} + +src_compile() { + # Filter unsupported linker flags + filter-flags '-Wl,*' + + [[ -f hack/apparmor_tag.sh ]] || die + if use apparmor; then + echo -e "#!/bin/sh\necho apparmor" > hack/apparmor_tag.sh || die + else + echo -e "#!/bin/sh\ntrue" > hack/apparmor_tag.sh || die + fi + + [[ -f hack/btrfs_installed_tag.sh ]] || die + if use btrfs; then + echo -e "#!/bin/sh\ntrue" > hack/btrfs_installed_tag.sh || die + else + echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \ + hack/btrfs_installed_tag.sh || die + fi + + [[ -f hack/selinux_tag.sh ]] || die + if use selinux; then + echo -e "#!/bin/sh\necho selinux" > hack/selinux_tag.sh || die + else + echo -e "#!/bin/sh\ntrue" > hack/selinux_tag.sh || die + fi + + # Avoid this error when generating pkg/varlink/iopodman.go: + # cannot find package "github.com/varlink/go/varlink/idl" + mkdir -p _output || die + ln -snf ../vendor _output/src || die + GO111MODULE=off GOPATH=${PWD}/_output go generate ./pkg/varlink/... || die + rm _output/src || die + + export -n GOCACHE GOPATH XDG_CACHE_HOME + GOBIN="${S}/bin" \ + emake all \ + GIT_BRANCH=master \ + GIT_BRANCH_CLEAN=master \ + COMMIT_NO="${EGIT_COMMIT}" \ + GIT_COMMIT="${EGIT_COMMIT}" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install + + insinto /etc/containers + newins test/registries.conf registries.conf.example + newins test/policy.json policy.json.example + + insinto /usr/share/containers + doins seccomp.json + + newinitd "${FILESDIR}"/podman.initd podman + + insinto /etc/logrotate.d + newins "${FILESDIR}/podman.logrotated" podman + + dobashcomp completions/bash/* + + keepdir /var/lib/containers +} + +pkg_preinst() { + LIBPOD_ROOTLESS_UPGRADE=false + if use rootless; then + has_version 'app-emulation/libpod[rootless]' || LIBPOD_ROOTLESS_UPGRADE=true + fi +} + +pkg_postinst() { + local want_newline=false + if [[ ! ( -e ${EROOT%/*}/etc/containers/policy.json && -e ${EROOT%/*}/etc/containers/registries.conf ) ]]; then + elog "You need to create the following config files:" + elog "/etc/containers/registries.conf" + elog "/etc/containers/policy.json" + elog "To copy over default examples, use:" + elog "cp /etc/containers/registries.conf{.example,}" + elog "cp /etc/containers/policy.json{.example,}" + want_newline=true + fi + if [[ ${LIBPOD_ROOTLESS_UPGRADE} == true ]] ; then + ${want_newline} && elog "" + elog "For rootless operation, you need to configure subuid/subgid" + elog "for user running podman. In case subuid/subgid has only been" + elog "configured for root, run:" + elog "usermod --add-subuids 1065536-1131071 " + elog "usermod --add-subgids 1065536-1131071 " + want_newline=true + fi +}