Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/podman/
Date: Thu, 25 Feb 2021 22:09:38
Message-Id: 1614290969.a18840200a21a31f189ca330a3061791c0ed53c2.zmedico@gentoo
1 commit: a18840200a21a31f189ca330a3061791c0ed53c2
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 25 21:45:15 2021 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 25 22:09:29 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1884020
7
8 app-emulation/podman: Bump to version 3.0.1
9
10 Bug: https://bugs.gentoo.org/768597
11 Closes: https://bugs.gentoo.org/770505
12 Package-Manager: Portage-3.0.15, Repoman-3.0.2
13 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
14
15 app-emulation/podman/Manifest | 1 +
16 app-emulation/podman/podman-3.0.1.ebuild | 165 +++++++++++++++++++++++++++++++
17 2 files changed, 166 insertions(+)
18
19 diff --git a/app-emulation/podman/Manifest b/app-emulation/podman/Manifest
20 index 41fac527191..0bcd773bc36 100644
21 --- a/app-emulation/podman/Manifest
22 +++ b/app-emulation/podman/Manifest
23 @@ -1 +1,2 @@
24 DIST podman-2.2.1.tar.gz 9653842 BLAKE2B 4e86903fc8fb51b9b1aa2b46704c1828b4ea11b738eccf198260c678b175e0a8699120e0280a2803f7898c9b28040a75d489ccd09ebd9c1f45d10a86e2a26c8f SHA512 4c6eda9320daf18b5f0e892c0f3019a5658d983936c25a195bcb1fbc28c18a9a65e87043faddeb47e9f62c9b445efc2906a2b7ccedca877941fadb21b1b68367
25 +DIST podman-3.0.1.tar.gz 10365348 BLAKE2B 93a227bf1395145ebaec8e18aa8ad8101704e8e0f7344c8850ee9e1532b191aef96b1cbbba2e21bd716591d68969cfd16ee811621a383cb2d31e4105a44834bf SHA512 4addc986ad94b512d90b675a5a1988eeef365fff02c3449fd310582245a91d4ee96ff9fd3c56ce333a972dca627aa28fbd468a4a363c5c8963524bb67bc26754
26
27 diff --git a/app-emulation/podman/podman-3.0.1.ebuild b/app-emulation/podman/podman-3.0.1.ebuild
28 new file mode 100644
29 index 00000000000..f82494e1737
30 --- /dev/null
31 +++ b/app-emulation/podman/podman-3.0.1.ebuild
32 @@ -0,0 +1,165 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit bash-completion-r1 flag-o-matic go-module
39 +
40 +DESCRIPTION="Library and podman tool for running OCI-based containers in Pods"
41 +HOMEPAGE="https://github.com/containers/podman/"
42 +MY_PN=podman
43 +MY_P=${MY_PN}-${PV}
44 +SRC_URI="https://github.com/containers/podman/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"
45 +LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0"
46 +SLOT="0"
47 +
48 +KEYWORDS="~amd64 ~arm64"
49 +IUSE="apparmor btrfs +fuse +rootless selinux"
50 +RESTRICT="test"
51 +
52 +COMMON_DEPEND="
53 + app-crypt/gpgme:=
54 + >=app-emulation/conmon-2.0.0
55 + || ( >=app-emulation/runc-1.0.0_rc6 app-emulation/crun )
56 + dev-libs/libassuan:=
57 + dev-libs/libgpg-error:=
58 + >=net-misc/cni-plugins-0.8.6
59 + sys-fs/lvm2
60 + sys-libs/libseccomp:=
61 +
62 + apparmor? ( sys-libs/libapparmor )
63 + btrfs? ( sys-fs/btrfs-progs )
64 + rootless? ( app-emulation/slirp4netns )
65 + selinux? ( sys-libs/libselinux:= )
66 +"
67 +DEPEND="
68 + ${COMMON_DEPEND}
69 + dev-go/go-md2man"
70 +RDEPEND="${COMMON_DEPEND}
71 + fuse? ( sys-fs/fuse-overlayfs )"
72 +
73 +S=${WORKDIR}/${MY_P}
74 +
75 +src_prepare() {
76 + default
77 +
78 + # Disable installation of python modules here, since those are
79 + # installed by separate ebuilds.
80 + local makefile_sed_args=(
81 + -e '/^GIT_.*/d'
82 + -e 's/$(GO) build/$(GO) build -v -work -x/'
83 + -e 's/^\(install:.*\) install\.python$/\1/'
84 + -e 's|^pkg/varlink/iopodman.go: .gopathok pkg/varlink/io.podman.varlink$|pkg/varlink/iopodman.go: pkg/varlink/io.podman.varlink|'
85 + )
86 +
87 + has_version -b '>=dev-lang/go-1.13.9' || makefile_sed_args+=(-e 's:GO111MODULE=off:GO111MODULE=on:')
88 +
89 + sed "${makefile_sed_args[@]}" -i Makefile || die
90 +
91 + sed -e 's|OUTPUT="${CIRRUS_TAG:.*|OUTPUT='v${PV}'|' \
92 + -i hack/get_release_info.sh || die
93 +}
94 +
95 +src_compile() {
96 + local git_commit
97 + git_commit=$(grep '^[[:space:]]*gitCommit[[:space:]]' vendor/k8s.io/client-go/pkg/version/base.go)
98 + git_commit=${git_commit#*\"}
99 + git_commit=${git_commit%\"*}
100 + [[ ${git_commit} ]] || die "failed to determine gitCommit"
101 +
102 + # Filter unsupported linker flags
103 + filter-flags '-Wl,*'
104 +
105 + [[ -f hack/apparmor_tag.sh ]] || die
106 + if use apparmor; then
107 + echo -e "#!/bin/sh\necho apparmor" > hack/apparmor_tag.sh || die
108 + else
109 + echo -e "#!/bin/sh\ntrue" > hack/apparmor_tag.sh || die
110 + fi
111 +
112 + [[ -f hack/btrfs_installed_tag.sh ]] || die
113 + if use btrfs; then
114 + echo -e "#!/bin/sh\ntrue" > hack/btrfs_installed_tag.sh || die
115 + else
116 + echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \
117 + hack/btrfs_installed_tag.sh || die
118 + fi
119 +
120 + [[ -f hack/selinux_tag.sh ]] || die
121 + if use selinux; then
122 + echo -e "#!/bin/sh\necho selinux" > hack/selinux_tag.sh || die
123 + else
124 + echo -e "#!/bin/sh\ntrue" > hack/selinux_tag.sh || die
125 + fi
126 +
127 + # Avoid this error when generating pkg/varlink/iopodman.go:
128 + # cannot find package "github.com/varlink/go/varlink/idl"
129 + mkdir -p _output || die
130 + ln -snf ../vendor _output/src || die
131 + GO111MODULE=off GOPATH=${PWD}/_output go generate ./pkg/varlink/... || die
132 + rm _output/src || die
133 +
134 + export -n GOCACHE GOPATH XDG_CACHE_HOME
135 + GOBIN="${S}/bin" \
136 + emake all \
137 + GIT_BRANCH=master \
138 + GIT_BRANCH_CLEAN=master \
139 + COMMIT_NO="${git_commit}" \
140 + GIT_COMMIT="${git_commit}"
141 +}
142 +
143 +src_install() {
144 + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
145 +
146 + insinto /etc/containers
147 + newins test/registries.conf registries.conf.example
148 + newins test/policy.json policy.json.example
149 +
150 + insinto /usr/share/containers
151 + doins vendor/github.com/containers/common/pkg/seccomp/seccomp.json
152 +
153 + newconfd "${FILESDIR}"/podman.confd podman
154 + newinitd "${FILESDIR}"/podman.initd podman
155 +
156 + insinto /etc/logrotate.d
157 + newins "${FILESDIR}/podman.logrotated" podman
158 +
159 + dobashcomp completions/bash/*
160 +
161 + insinto /usr/share/zsh/site-functions
162 + doins completions/zsh/*
163 +
164 + insinto /usr/share/fish/vendor_completions.d
165 + doins completions/fish/*
166 +
167 + keepdir /var/lib/containers
168 +}
169 +
170 +pkg_preinst() {
171 + PODMAN_ROOTLESS_UPGRADE=false
172 + if use rootless; then
173 + has_version 'app-emulation/podman[rootless]' || PODMAN_ROOTLESS_UPGRADE=true
174 + fi
175 +}
176 +
177 +pkg_postinst() {
178 + local want_newline=false
179 + if [[ ! ( -e ${EROOT%/*}/etc/containers/policy.json && -e ${EROOT%/*}/etc/containers/registries.conf ) ]]; then
180 + elog "You need to create the following config files:"
181 + elog "/etc/containers/registries.conf"
182 + elog "/etc/containers/policy.json"
183 + elog "To copy over default examples, use:"
184 + elog "cp /etc/containers/registries.conf{.example,}"
185 + elog "cp /etc/containers/policy.json{.example,}"
186 + want_newline=true
187 + fi
188 + if [[ ${PODMAN_ROOTLESS_UPGRADE} == true ]] ; then
189 + ${want_newline} && elog ""
190 + elog "For rootless operation, you need to configure subuid/subgid"
191 + elog "for user running podman. In case subuid/subgid has only been"
192 + elog "configured for root, run:"
193 + elog "usermod --add-subuids 1065536-1131071 <user>"
194 + elog "usermod --add-subgids 1065536-1131071 <user>"
195 + want_newline=true
196 + fi
197 +}