app-emulation/libpod: add package

This commit is contained in:
Alexander Miroshnichenko 2021-01-01 22:27:19 +03:00
parent fb3e41b6a8
commit 118afc7e4b
Signed by: alex
GPG Key ID: E93720C6C73A77F4
5 changed files with 168 additions and 0 deletions

View File

@ -0,0 +1,4 @@
AUX 0001-Disable-Makefile-selinux-install-options.patch 1030 BLAKE2B 6bbf498617fbba959d7de39d992c6e057a04f37e9e14b4479ab257106ffdf9369e534b2e62059e4c46fd0280d09da64fc3057d413334a4f978a69b216b1e96af SHA512 9d4458be3e0fa5835076a8e0db7c46aa50dfd5d60585a5a9fb7d3854b0cc286e7cd532d908369a89d2c74804bc2f1569759b1a134f83cc6e64fea8f67e9b1151
AUX podman.initd 566 BLAKE2B ccfedaea85b03a09446b678460d53591e62a9d8a1c205bd850fd95b4ce0ed47ebf767830fb9d30d32f1c0a4a1868eeb83c2c7deaef1617c0e6e91899807f0c36 SHA512 561c72d71827e523ab177b38961e38a594a14da8c6f0490d5743f35f4d02f4d813b43d9b3a66dd1aa72701c7d9a88ac6bb3a8435e72afcfa23289cce460bdb04
AUX podman.logrotated 85 BLAKE2B 730899f93ee354e476629276b69224cfeaaa1603b6690cac3c0cd905cd75add19179f99e26f29edbd963d5f44c38a3a2db0b5a3613dc665ab801654eac13dc2e SHA512 0136d063b15b07c41a9370ba1845c4f368ec46a7a30683b7ff7cbb0b12e5b2711c9a45329f5102af6a969e562edcec006a8de9055e43e1caf9395847d0c5ec45
EBUILD libpod-2.2.1-r9.ebuild 2962 BLAKE2B 93f2ba0751bcbb34ae3a0b7d0dec58db542323623bbea21d73e1839cabae91ee68c63bc3b743f981636a1c5796bc6bf4b0410721556ca6bb61bd2ee699495e72 SHA512 e4e8df0f4ca3ae4ab61ad58471776ea5afdb05937f67f02ff03968af022793eca5e1d80659b14af99860ec9f5486c0217dc585b5a91ffc375e36faa7aa4547f6

View File

@ -0,0 +1,28 @@
From 2b3cd87ab0470ed6857b80b34c60e118724523e3 Mon Sep 17 00:00:00 2001
From: Alexander Miroshnichenko <alex@millerson.name>
Date: Fri, 1 Jan 2021 17:52:07 +0300
Subject: [PATCH] Disable Makefile selinux install options
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 0316ea28452e..9bb06a1cad4b 100644
--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,7 @@ BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
ZSHINSTALLDIR=${PREFIX}/share/zsh/site-functions
FISHINSTALLDIR=${PREFIX}/share/fish/vendor_completions.d
-SELINUXOPT ?= $(shell test -x /usr/sbin/selinuxenabled && selinuxenabled && echo -Z)
+SELINUXOPT ?= $(shell /bin/false && echo -Z)
COMMIT_NO ?= $(shell git rev-parse HEAD 2> /dev/null || true)
GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
--
2.26.2

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
}

View File

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

View File

@ -0,0 +1,112 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit eutils git-r3
DESCRIPTION="Library and podman tool for running OCI-based containers in Pods"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64"
EGIT_REPO_URI=https://github.com/containers/podman.git
EGIT_BRANCH=v2.2.1-rhel
EGIT_COMMIT=a0d478edea7f775b7ce32f8eb1a01e75374486cb
IUSE="apparmor btrfs +fuse selinux systemd seccomp +rootless"
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
seccomp? ( sys-libs/libseccomp:= )
rootless? ( app-emulation/slirp4netns )
apparmor? ( sys-libs/libapparmor )
btrfs? ( sys-fs/btrfs-progs )
selinux? ( sys-libs/libselinux:= )
systemd? ( sys-apps/systemd )"
DEPEND="
${COMMON_DEPEND}
dev-go/go-md2man"
RDEPEND="${COMMON_DEPEND}
fuse? ( sys-fs/fuse-overlayfs )"
RESTRICT="network-sandbox"
PATCHES=(
"${FILESDIR}"/0001-Disable-Makefile-selinux-install-options.patch
)
src_compile() {
local myargs=(
$(usex btrfs "" exclude_graphdriver_btrfs)
$(usev apparmor)
$(usev seccomp)
$(usev selinux)
$(usev systemd)
exclude_graphdriver_devicemapper
)
local tags="${myargs[@]}"
emake PREFIX=/usr BUILDTAGS="${tags}"
}
src_install() {
emake install PREFIX=/usr DESTDIR="${D}"
insinto /etc/containers
newins test/registries.conf registries.conf.example
newins test/policy.json policy.json.example
insinto /usr/share/containers
doins vendor/github.com/containers/common/pkg/seccomp/seccomp.json
newinitd "${FILESDIR}"/podman.initd podman
insinto /etc/logrotate.d
newins "${FILESDIR}/podman.logrotated" podman
dobashcomp completions/bash/*
insinto /usr/share/zsh/site-functions
doins completions/zsh/*
insinto /usr/share/fish/vendor_completions.d
doins completions/fish/*
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
}