Browse Source

bumped libpod in order to address https://github.com/containers/podman/issues/6857

master
Tamás Gérczei 3 months ago
parent
commit
81d86eeb07
4 changed files with 180 additions and 0 deletions
  1. +4
    -0
      app-emulation/libpod/Manifest
  2. +17
    -0
      app-emulation/libpod/files/podman.initd
  3. +7
    -0
      app-emulation/libpod/files/podman.logrotated
  4. +152
    -0
      app-emulation/libpod/libpod-2.0.2.ebuild

+ 4
- 0
app-emulation/libpod/Manifest View File

@@ -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

+ 17
- 0
app-emulation/libpod/files/podman.initd View File

@@ -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
}

+ 7
- 0
app-emulation/libpod/files/podman.logrotated View File

@@ -0,0 +1,7 @@
/var/log/podman/podman.log {
missingok
size 5M
rotate 3
compress
copytruncate
}

+ 152
- 0
app-emulation/libpod/libpod-2.0.2.ebuild View File

@@ -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 <user>"
elog "usermod --add-subgids 1065536-1131071 <user>"
want_newline=true
fi
}

Loading…
Cancel
Save