diff options
author | Samuel Bernardo <samuelbernardo.mail@gmail.com> | 2024-06-11 22:55:54 +0100 |
---|---|---|
committer | Samuel Bernardo <samuelbernardo.mail@gmail.com> | 2024-06-11 22:55:54 +0100 |
commit | ff28226b7c7fd4a2c3ec202a38fda322a5685a89 (patch) | |
tree | 9625084aa250beca50a625e12607c80cca066692 /app-containers | |
parent | Add cri-o and cni-plugins latest releases (diff) | |
download | ssnb-ff28226b7c7fd4a2c3ec202a38fda322a5685a89.tar.gz ssnb-ff28226b7c7fd4a2c3ec202a38fda322a5685a89.tar.bz2 ssnb-ff28226b7c7fd4a2c3ec202a38fda322a5685a89.zip |
Add podman latest release
Signed-off-by: Samuel Bernardo <samuelbernardo.mail@gmail.com>
Diffstat (limited to 'app-containers')
-rw-r--r-- | app-containers/podman/Manifest | 13 | ||||
-rw-r--r-- | app-containers/podman/files/podman-5.0.0_rc4.confd | 11 | ||||
-rw-r--r-- | app-containers/podman/files/podman-5.0.0_rc4.initd | 21 | ||||
-rw-r--r-- | app-containers/podman/files/podman-auto-update-5.0.0.cron | 5 | ||||
-rw-r--r-- | app-containers/podman/files/podman-clean-transient-5.0.0_rc6.confd | 8 | ||||
-rw-r--r-- | app-containers/podman/files/podman-clean-transient-5.0.0_rc6.initd | 17 | ||||
-rw-r--r-- | app-containers/podman/files/podman-restart-5.0.0_rc4.confd | 9 | ||||
-rw-r--r-- | app-containers/podman/files/podman-restart-5.0.0_rc4.initd | 22 | ||||
-rw-r--r-- | app-containers/podman/files/podman.logrotated | 7 | ||||
-rw-r--r-- | app-containers/podman/files/seccomp-toggle-4.7.0.patch | 15 | ||||
-rw-r--r-- | app-containers/podman/metadata.xml | 51 | ||||
-rw-r--r-- | app-containers/podman/podman-5.1.1.ebuild | 134 | ||||
-rw-r--r-- | app-containers/podman/podman-9999.ebuild | 134 |
13 files changed, 447 insertions, 0 deletions
diff --git a/app-containers/podman/Manifest b/app-containers/podman/Manifest new file mode 100644 index 0000000..dc29368 --- /dev/null +++ b/app-containers/podman/Manifest @@ -0,0 +1,13 @@ +AUX podman-5.0.0_rc4.confd 323 BLAKE2B 19bb62e91673791a46f7992b79190c8207636a8fe38fb12250e904acb5e86112603dabfeacf878c597e636b489475f113556bc82376d3c54c2f042a50530261a SHA512 9356733d5922d18f135d013470b03e10c1f9834cb59f72bc2bcab2fc8f2d70f242abf7c9f87e22dda0f5cc791218878278f3d7b341fd81a5c9edd5f0f672420c +AUX podman-5.0.0_rc4.initd 651 BLAKE2B 3a0673f823b1adda553b2453512c29c63f00d42bce0ee6d49227b410e0d74dfa4a941c1220845153c2fa538269658577f13ede74b061d7758171e7ba29d57263 SHA512 25bf6275e49cdc130a21d3f553ba19c5e3913efbb98855497c91a20dc3f43dff6db9796a2791473d44f04faa652230ff0698a7c1e6b091073ea9ca4922e63a26 +AUX podman-auto-update-5.0.0.cron 185 BLAKE2B 78553b31c4f2f9fe929780af752cee33db0e95944275853b1ef641416d9d10cd8a12af73b2f14f330d24e5961f17ac06c4dde47b1dc98de38cf3576995bb9607 SHA512 ae34ee8936d5a16dfad92afb4d9830ae4b06bd10ee4f36b4ad642c6690af025a73b169507f68926a14e3274c92fa49d0f9994334fc4ca369aa6137722a5cb8fc +AUX podman-clean-transient-5.0.0_rc6.confd 235 BLAKE2B 25100f79c09c4ea388be27ed5e2d5f537d790688ad808cc02183d3e1f86d791f69133d3a3d1137179dd48d70aa1769a2b3ada77d17b7f25cf1b3007c2c243bc2 SHA512 f27408326c5b50addfc8b11c6f41df49d03ccaab80d37bb84100d2d238e01117ea436a79833f80c6b1d62b03da01807871396f401bf155d0c08252cc783f7e15 +AUX podman-clean-transient-5.0.0_rc6.initd 669 BLAKE2B db5f35d6918ea12afd2bc6ef1eb9b855faa259a7abe9a49895892e40576558996317ae0189b80d1d2fea978848e35bfbadf1635cef112bd96bfeb75ecf34cdb3 SHA512 95c07cd6bc1bba7ce9bb0e111d74d9625c7f7e88667f709852056206e9483d96283ad2f13710e99bc5c3573bdb1b0c7585a7254760b91b7eec5b5a868d849e61 +AUX podman-restart-5.0.0_rc4.confd 284 BLAKE2B e2e5394428d95e9fa480f32ef3efcddc870394e8f5158fbcfe80434aca6c0a48bc1a4a5b7bdcf91e5313121be7f50f5e924a3a2084767e84d6bf045819121711 SHA512 99818e90a04ebdfa2ca8fbf8b4971025cae27807a0f2288f267c60e875f38cac4d189a72248861507189aa3a1e05f7c81d663f96ddac6a7e11edebf5f18baea1 +AUX podman-restart-5.0.0_rc4.initd 641 BLAKE2B c62aa18fe0da2d00032f09bc2e23debfc916c12a9ebdd22666c000c09242140b592fb08f1e961cf2dc66eb9eeb6ddaf7336713574fb2708620588904168ded51 SHA512 b947c3f6e3dc4d58008c16c7bc77306877b7375334eeb96a714541c8534bcb4ca25d85e2204af96a3d14471b966c0b59542694777b907dddeff15f8995889a2c +AUX podman.logrotated 85 BLAKE2B 730899f93ee354e476629276b69224cfeaaa1603b6690cac3c0cd905cd75add19179f99e26f29edbd963d5f44c38a3a2db0b5a3613dc665ab801654eac13dc2e SHA512 0136d063b15b07c41a9370ba1845c4f368ec46a7a30683b7ff7cbb0b12e5b2711c9a45329f5102af6a969e562edcec006a8de9055e43e1caf9395847d0c5ec45 +AUX seccomp-toggle-4.7.0.patch 400 BLAKE2B 9f02e58c06b507a294207c66bd5ea218f87803a9b9f0ddafc86a8b21df912589357adf054302e5a69d300155bdf8dcd8b77c18c1ddf8a4042ae1f05de5faf46d SHA512 e507e3a52d2f5f48b65fdb77ceaa095f13fda3e834dafc976bcd291cb35755da879c9c99b7950b2905399dedf4ac3370bd70462343648613a7c6aedc141d7ef7 +DIST podman-5.1.1.tar.gz 23794366 BLAKE2B 0612a148972c96f532e96a8eb1ab388d80b32fe2ca7c5626e615748ef269a853407aeb39f34686d9eb75de239882e524cf5ee7c97152caccf5f77eb6ecfd54d8 SHA512 e896ee97980da4a522eb865d2eacb6876dd8bc5be1488aed8bd81a81af95faa1383b176b5d236d4af0f76bc30ddad5230df3e11c59ffc6f86e5b4cf3876ff184 +EBUILD podman-5.1.1.ebuild 3581 BLAKE2B 9e0e9beb556ac2cb7ccfc3ecb8f41d5fdd44945dc53b65ce55c06dd02aacddec7b6921b703d2da59a0f01c90a21c5f2c1c5a32bcebd1ddb0964ecae1c43b8617 SHA512 b613ceab57b3ff1c4d1b84e1dbaaaed4b70cddaf5e71338416f8c4d300fb1b95e1e7f5d23efb51cc90511f208dccbc4d00bf0c45e98f215411bb13bfd5f61284 +EBUILD podman-9999.ebuild 3581 BLAKE2B 9e0e9beb556ac2cb7ccfc3ecb8f41d5fdd44945dc53b65ce55c06dd02aacddec7b6921b703d2da59a0f01c90a21c5f2c1c5a32bcebd1ddb0964ecae1c43b8617 SHA512 b613ceab57b3ff1c4d1b84e1dbaaaed4b70cddaf5e71338416f8c4d300fb1b95e1e7f5d23efb51cc90511f208dccbc4d00bf0c45e98f215411bb13bfd5f61284 +MISC metadata.xml 1709 BLAKE2B 0138cd1f7fec54f2b15f8a8af7a29ee0202b0c824371ed6f45726c06e84c5a0c78e6446f817ee2b81c44320203b50c54072757b9cd271080cd07a072141760ce SHA512 65fdac8344812dd71fcf7018da7320a055870f48af6c4f623a9c65f5375e69eee142409ff3451c5e046eef648e0ac00bf96550a7dfc37be5b7aa3aff1a51d42b diff --git a/app-containers/podman/files/podman-5.0.0_rc4.confd b/app-containers/podman/files/podman-5.0.0_rc4.confd new file mode 100644 index 0000000..eafaee7 --- /dev/null +++ b/app-containers/podman/files/podman-5.0.0_rc4.confd @@ -0,0 +1,11 @@ +# Config file for /etc/init.d/podman + +# Sets the API service daemon log level +# valid levels: debug, info, warn, error, fatal or panic +#LOG_LEVEL="error" + +# Sets the API service daemon socket +#SOCKET="unix:///run/podman/podman.sock" + +# Configure the user[:group] the API service daemon will run as +#RUN_AS_USER="root:root" diff --git a/app-containers/podman/files/podman-5.0.0_rc4.initd b/app-containers/podman/files/podman-5.0.0_rc4.initd new file mode 100644 index 0000000..53026a5 --- /dev/null +++ b/app-containers/podman/files/podman-5.0.0_rc4.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 2015-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Podman API Service" + +LOG_PATH="/var/log/${RC_SVCNAME}" +output_log="${LOG_PATH}/${RC_SVCNAME}.log" +error_log="${LOG_PATH}/${RC_SVCNAME}.log" +RUN_PATH="/run/${RC_SVCNAME}" +pidfile="${RUN_PATH}/${RC_SVCNAME}.pid" + +command_user="${RUN_AS_USER:=root:root}" +command="/usr/bin/podman" +command_args="--log-level ${LOG_LEVEL:-error} system service --time 0 ${SOCKET:-unix://${RUN_PATH}/${RC_SVCNAME}.sock}" +command_background="true" + +start() { + checkpath -o "${RUN_AS_USER}" -d "${RUN_PATH}" "${LOG_PATH}" + default_start +} diff --git a/app-containers/podman/files/podman-auto-update-5.0.0.cron b/app-containers/podman/files/podman-auto-update-5.0.0.cron new file mode 100644 index 0000000..509146e --- /dev/null +++ b/app-containers/podman/files/podman-auto-update-5.0.0.cron @@ -0,0 +1,5 @@ +#!/bin/sh + +# podman-auto-update(1) +# uncomment following to auto update containers according to their auto-update policy +# /usr/bin/podman auto-update && /usr/bin/podman image prune -f diff --git a/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.confd b/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.confd new file mode 100644 index 0000000..e85d8d5 --- /dev/null +++ b/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.confd @@ -0,0 +1,8 @@ +# Config file for /etc/init.d/podman-clean-transient + +# Sets the podman log level +# valid levels: debug, info, warn, error, fatal or panic +#LOG_LEVEL="info" + +# Configure the user[:group] the podman will run as +#RUN_AS_USER="root:root" diff --git a/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.initd b/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.initd new file mode 100644 index 0000000..cd759c7 --- /dev/null +++ b/app-containers/podman/files/podman-clean-transient-5.0.0_rc6.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 2015-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# This service runs once each boot to remove potential leftover +# container state from previous boots. + +# This is needed when using transient storage mode in podman where the +# database and other configs are stored in tmpfs, but some other files +# are not. If we don't run this after an unclean boot then there may +# be some leftover files that grow over time. + +description="Clean up podman transient data" + +command_user="${RUN_AS_USER:-root:root}" +command="/usr/bin/podman" +command_args="--log-level ${LOG_LEVEL:-info} system prune --external" diff --git a/app-containers/podman/files/podman-restart-5.0.0_rc4.confd b/app-containers/podman/files/podman-restart-5.0.0_rc4.confd new file mode 100644 index 0000000..4d63848 --- /dev/null +++ b/app-containers/podman/files/podman-restart-5.0.0_rc4.confd @@ -0,0 +1,9 @@ +# Config file for /etc/init.d/podman-restart + +# Sets the podman log level +# valid levels: debug, info, warn, error, fatal or panic +#LOG_LEVEL="info" + +# Configure the user[:group] the podman will run as +# Can be useful to manage rootful or rootless containers +#RUN_AS_USER="root:root" diff --git a/app-containers/podman/files/podman-restart-5.0.0_rc4.initd b/app-containers/podman/files/podman-restart-5.0.0_rc4.initd new file mode 100644 index 0000000..d02bd64 --- /dev/null +++ b/app-containers/podman/files/podman-restart-5.0.0_rc4.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 2015-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Start all containers with restart-policy set to always" + +command_user="${RUN_AS_USER:=root:root}" +command="/usr/bin/podman" +command_args="--log-level ${LOG_LEVEL:=info} start --all --filter restart-policy=always" + +depend() { + after net +} + +stop() { + ebegin "Stopping all containers with restart-policy set to always" + ${command} \ + --log-level ${LOG_LEVEL} \ + stop \ + $(${command} container ls --filter restart-policy=always -q) + eend $? "Failed to stop containers with restart-policy set to always" +} diff --git a/app-containers/podman/files/podman.logrotated b/app-containers/podman/files/podman.logrotated new file mode 100644 index 0000000..b9d7234 --- /dev/null +++ b/app-containers/podman/files/podman.logrotated @@ -0,0 +1,7 @@ +/var/log/podman/podman.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-containers/podman/files/seccomp-toggle-4.7.0.patch b/app-containers/podman/files/seccomp-toggle-4.7.0.patch new file mode 100644 index 0000000..17a09b6 --- /dev/null +++ b/app-containers/podman/files/seccomp-toggle-4.7.0.patch @@ -0,0 +1,15 @@ +--- a/Makefile ++++ b/Makefile +@@ -57,7 +57,11 @@ + $(shell hack/systemd_tag.sh) \ + $(shell hack/libsubid_tag.sh) \ + exclude_graphdriver_devicemapper \ +- seccomp ++ ++BUILD_SECCOMP ?= yes ++ifeq ($(BUILD_SECCOMP),yes) ++BUILDTAGS += seccomp ++endif + # N/B: This value is managed by Renovate, manual changes are + # possible, as long as they don't disturb the formatting + # (i.e. DO NOT ADD A 'v' prefix!) diff --git a/app-containers/podman/metadata.xml b/app-containers/podman/metadata.xml new file mode 100644 index 0000000..59ab2d3 --- /dev/null +++ b/app-containers/podman/metadata.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zmedico@gentoo.org</email> + <name>Zac Medico</name> + </maintainer> + <maintainer type="person" proxied="yes"> + <email>me@rahil.rocks</email> + <name>Rahil Bhimjiani</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription lang="en"> + Podman (the POD MANager) is a tool for managing containers + and images, volumes mounted into those containers, and pods + made from groups of containers. Podman is based on libpod, + a library for container lifecycle management that is also + contained in this repository. The libpod library provides + APIs for managing containers, pods, container images, + and volumes. + </longdescription> + <use> + <flag name="btrfs"> + Enables btrfs support (graph driver) in Podman + </flag> + <flag name="cgroup-hybrid"> + Use legacy (hybrid) cgroups instead of modern (unified) cgroups + </flag> + <flag name="fuse"> + Enables fuse dependencies (fuse-overlayfs is especially useful + for rootless mode). + </flag> + <flag name="init"> + Enables catatonit dependency required for podman run --init. + </flag> + <flag name="rootless"> + Enables dependencies for running in rootless mode. + </flag> + <flag name="wrapper"> + Install wrapper which lets use podman for command `docker` + </flag> + </use> + <upstream> + <remote-id type="github">containers/podman</remote-id> + <bugs-to>https://github.com/containers/podman/issues</bugs-to> + <doc>https://podman.io/docs</doc> + </upstream> +</pkgmetadata> diff --git a/app-containers/podman/podman-5.1.1.ebuild b/app-containers/podman/podman-5.1.1.ebuild new file mode 100644 index 0000000..738613b --- /dev/null +++ b/app-containers/podman/podman-5.1.1.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11,12} ) + +inherit go-module python-any-r1 tmpfiles toolchain-funcs linux-info + +DESCRIPTION="A tool for managing OCI containers and pods with Docker-compatible CLI" +HOMEPAGE="https://github.com/containers/podman/ https://podman.io/" + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/containers/podman.git" +else + SRC_URI="https://github.com/containers/podman/archive/v${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${P/_rc/-rc}" + [[ ${PV} != *rc* ]] && \ + KEYWORDS="~amd64 ~arm64 ~riscv" +fi + +# main pkg +LICENSE="Apache-2.0" +# deps +LICENSE+=" BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0" +SLOT="0" +IUSE="apparmor btrfs +seccomp selinux systemd wrapper" +RESTRICT="test" + +RDEPEND=" + app-containers/catatonit + >=app-containers/conmon-2.1.10 + >=app-containers/containers-common-0.58.0-r1 + app-crypt/gpgme:= + dev-libs/libassuan:= + dev-libs/libgpg-error:= + sys-apps/shadow:= + + apparmor? ( sys-libs/libapparmor ) + btrfs? ( sys-fs/btrfs-progs ) + wrapper? ( !app-containers/docker-cli ) + seccomp? ( sys-libs/libseccomp:= ) + selinux? ( sec-policy/selinux-podman sys-libs/libselinux:= ) + systemd? ( sys-apps/systemd:= ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + ${PYTHON_DEPS} + dev-go/go-md2man +" + +PATCHES=( + "${FILESDIR}/seccomp-toggle-4.7.0.patch" +) + +CONFIG_CHECK=" + ~USER_NS +" + +pkg_setup() { + use btrfs && CONFIG_CHECK+=" ~BTRFS_FS" + linux-info_pkg_setup + python-any-r1_pkg_setup +} + +src_prepare() { + default + + # assure necessary files are present + local file + for file in apparmor_tag btrfs_installed_tag btrfs_tag systemd_tag; do + [[ -f hack/"${file}".sh ]] || die + done + + local feature + for feature in apparmor systemd; do + cat <<-EOF > hack/"${feature}"_tag.sh || die + #!/usr/bin/env bash + $(usex ${feature} "echo ${feature}" echo) + EOF + done + + echo -e "#!/usr/bin/env bash\n echo" > hack/btrfs_installed_tag.sh || die + cat <<-EOF > hack/btrfs_tag.sh || die + #!/usr/bin/env bash + $(usex btrfs echo 'echo exclude_graphdriver_btrfs btrfs_noversion') + EOF +} + +src_compile() { + export PREFIX="${EPREFIX}/usr" + + # For non-live versions, prevent git operations which causes sandbox violations + # https://github.com/gentoo/gentoo/pull/33531#issuecomment-1786107493 + [[ ${PV} != 9999* ]] && export COMMIT_NO="" GIT_COMMIT="" EPOCH_TEST_COMMIT="" + + # Use proper pkg-config to get gpgme cflags and ldflags when + # cross-compiling, bug 930982. + if tc-is-cross-compiler; then + tc-export PKG_CONFIG + fi + + # BUILD_SECCOMP is used in the patch to toggle seccomp + emake BUILDFLAGS="-v -work -x" GOMD2MAN="go-md2man" BUILD_SECCOMP="$(usex seccomp)" \ + all $(usev wrapper docker-docs) +} + +src_install() { + emake DESTDIR="${D}" install install.completions $(usev wrapper install.docker-full) + + if use !systemd; then + newconfd "${FILESDIR}"/podman-5.0.0_rc4.confd podman + newinitd "${FILESDIR}"/podman-5.0.0_rc4.initd podman + + newinitd "${FILESDIR}"/podman-restart-5.0.0_rc4.initd podman-restart + newconfd "${FILESDIR}"/podman-restart-5.0.0_rc4.confd podman-restart + + newinitd "${FILESDIR}"/podman-clean-transient-5.0.0_rc6.initd podman-clean-transient + newconfd "${FILESDIR}"/podman-clean-transient-5.0.0_rc6.confd podman-clean-transient + + exeinto /etc/cron.daily + newexe "${FILESDIR}"/podman-auto-update-5.0.0.cron podman-auto-update + + insinto /etc/logrotate.d + newins "${FILESDIR}/podman.logrotated" podman + fi + + keepdir /var/lib/containers +} + +pkg_postinst() { + tmpfiles_process podman.conf $(usev wrapper podman-docker.conf) +} diff --git a/app-containers/podman/podman-9999.ebuild b/app-containers/podman/podman-9999.ebuild new file mode 100644 index 0000000..738613b --- /dev/null +++ b/app-containers/podman/podman-9999.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11,12} ) + +inherit go-module python-any-r1 tmpfiles toolchain-funcs linux-info + +DESCRIPTION="A tool for managing OCI containers and pods with Docker-compatible CLI" +HOMEPAGE="https://github.com/containers/podman/ https://podman.io/" + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/containers/podman.git" +else + SRC_URI="https://github.com/containers/podman/archive/v${PV/_rc/-rc}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${P/_rc/-rc}" + [[ ${PV} != *rc* ]] && \ + KEYWORDS="~amd64 ~arm64 ~riscv" +fi + +# main pkg +LICENSE="Apache-2.0" +# deps +LICENSE+=" BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0" +SLOT="0" +IUSE="apparmor btrfs +seccomp selinux systemd wrapper" +RESTRICT="test" + +RDEPEND=" + app-containers/catatonit + >=app-containers/conmon-2.1.10 + >=app-containers/containers-common-0.58.0-r1 + app-crypt/gpgme:= + dev-libs/libassuan:= + dev-libs/libgpg-error:= + sys-apps/shadow:= + + apparmor? ( sys-libs/libapparmor ) + btrfs? ( sys-fs/btrfs-progs ) + wrapper? ( !app-containers/docker-cli ) + seccomp? ( sys-libs/libseccomp:= ) + selinux? ( sec-policy/selinux-podman sys-libs/libselinux:= ) + systemd? ( sys-apps/systemd:= ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + ${PYTHON_DEPS} + dev-go/go-md2man +" + +PATCHES=( + "${FILESDIR}/seccomp-toggle-4.7.0.patch" +) + +CONFIG_CHECK=" + ~USER_NS +" + +pkg_setup() { + use btrfs && CONFIG_CHECK+=" ~BTRFS_FS" + linux-info_pkg_setup + python-any-r1_pkg_setup +} + +src_prepare() { + default + + # assure necessary files are present + local file + for file in apparmor_tag btrfs_installed_tag btrfs_tag systemd_tag; do + [[ -f hack/"${file}".sh ]] || die + done + + local feature + for feature in apparmor systemd; do + cat <<-EOF > hack/"${feature}"_tag.sh || die + #!/usr/bin/env bash + $(usex ${feature} "echo ${feature}" echo) + EOF + done + + echo -e "#!/usr/bin/env bash\n echo" > hack/btrfs_installed_tag.sh || die + cat <<-EOF > hack/btrfs_tag.sh || die + #!/usr/bin/env bash + $(usex btrfs echo 'echo exclude_graphdriver_btrfs btrfs_noversion') + EOF +} + +src_compile() { + export PREFIX="${EPREFIX}/usr" + + # For non-live versions, prevent git operations which causes sandbox violations + # https://github.com/gentoo/gentoo/pull/33531#issuecomment-1786107493 + [[ ${PV} != 9999* ]] && export COMMIT_NO="" GIT_COMMIT="" EPOCH_TEST_COMMIT="" + + # Use proper pkg-config to get gpgme cflags and ldflags when + # cross-compiling, bug 930982. + if tc-is-cross-compiler; then + tc-export PKG_CONFIG + fi + + # BUILD_SECCOMP is used in the patch to toggle seccomp + emake BUILDFLAGS="-v -work -x" GOMD2MAN="go-md2man" BUILD_SECCOMP="$(usex seccomp)" \ + all $(usev wrapper docker-docs) +} + +src_install() { + emake DESTDIR="${D}" install install.completions $(usev wrapper install.docker-full) + + if use !systemd; then + newconfd "${FILESDIR}"/podman-5.0.0_rc4.confd podman + newinitd "${FILESDIR}"/podman-5.0.0_rc4.initd podman + + newinitd "${FILESDIR}"/podman-restart-5.0.0_rc4.initd podman-restart + newconfd "${FILESDIR}"/podman-restart-5.0.0_rc4.confd podman-restart + + newinitd "${FILESDIR}"/podman-clean-transient-5.0.0_rc6.initd podman-clean-transient + newconfd "${FILESDIR}"/podman-clean-transient-5.0.0_rc6.confd podman-clean-transient + + exeinto /etc/cron.daily + newexe "${FILESDIR}"/podman-auto-update-5.0.0.cron podman-auto-update + + insinto /etc/logrotate.d + newins "${FILESDIR}/podman.logrotated" podman + fi + + keepdir /var/lib/containers +} + +pkg_postinst() { + tmpfiles_process podman.conf $(usev wrapper podman-docker.conf) +} |