Skip to content

Commit

Permalink
app-containers/containers-common: add 0.56.0 and live
Browse files Browse the repository at this point in the history
Common configs & docs for Containers eco-system (i.e. podman buildah skopeo...)

Go realm, executables are all in compiled, static, tidy in one binary but docs & configs...OMG all over the place. Spent whole day coding all these (such noob, I know), but was fun & fulfilling. Once this is merged the foundation of podman-stack is built, so will proceed to update frontend packages of eco-system.

Closes: https://bugs.gentoo.org/907805
Closes: https://bugs.gentoo.org/904433
Closes: https://bugs.gentoo.org/914456
Closes: https://bugs.gentoo.org/907804
Signed-off-by: Rahil Bhimjiani <rahil3108@gmail.com>
Closes: #32976
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
rahilarious authored and thesamesam committed Sep 21, 2023
1 parent 3e025f0 commit 2941140
Show file tree
Hide file tree
Showing 9 changed files with 1,290 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-containers/containers-common/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST containers-common-0.56.0.tar.gz 12616120 BLAKE2B 6495ca7d0c9134bc8bd5f7b7541bb4f1160c74abb7a64bd4d2124104ea563f5381f0092da20ab45d81929a8632b1fcc1107ac05fdae011be446cff14ebf88c45 SHA512 4af720be95e6b5ca7d0664f99a389bf092b9f45d4e0602d9b49ef1d21b359d2307a94e0c88378fe0c751f5b40db54d7aab67eb497185a289cea9288cbfaa042c
76 changes: 76 additions & 0 deletions app-containers/containers-common/containers-common-0.56.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Common config files and docs for Containers eco-system"
HOMEPAGE="https://github.com/containers/common"

if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/containers/common.git"
else
SRC_URI="https://github.com/containers/common/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${P#containers-}"
KEYWORDS="~amd64"
fi

LICENSE="Apache-2.0"
SLOT="0"

RDEPEND="
app-containers/containers-image
app-containers/containers-storage
app-containers/containers-shortnames
net-firewall/nftables
net-firewall/iptables[nftables]
|| ( app-containers/crun app-containers/runc )
|| (
( >=app-containers/netavark-1.6.0 >=app-containers/aardvark-dns-1.6.0 )
>=app-containers/cni-plugins-0.9.1
)
"

BDEPEND="
>=dev-go/go-md2man-2.0.2
"

src_prepare() {
default

[[ -f docs/Makefile ]] || die
sed -i -e 's|/usr/local|/usr|g;' docs/Makefile || die

eapply "${FILESDIR}/fix-warnings.patch"
}

src_configure() {
return
}

src_compile() {
emake docs
}

src_test() {
return
}

src_install() {
emake DESTDIR="${D}" install

insinto /etc/containers
# https://github.com/containers/skopeo/raw/main/default-policy.json
doins pkg/config/containers.conf "${FILESDIR}/policy.json"

insinto /etc/containers/registries.d
# https://github.com/containers/skopeo/raw/main/default.yaml
doins "${FILESDIR}/default.yaml"

insinto /usr/share/containers
# https://github.com/containers/common/raw/main/pkg/seccomp/seccomp.json
# https://github.com/containers/common/raw/main/pkg/subscriptions/mounts.conf
doins "${FILESDIR}/seccomp.json" "${FILESDIR}/mounts.conf"

keepdir /etc/containers/certs.d /etc/containers/oci/hooks.d /etc/containers/systemd /var/lib/containers/sigstore
}
76 changes: 76 additions & 0 deletions app-containers/containers-common/containers-common-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Common config files and docs for Containers eco-system"
HOMEPAGE="https://github.com/containers/common"

if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/containers/common.git"
else
SRC_URI="https://github.com/containers/common/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${P#containers-}"
KEYWORDS="~amd64"
fi

LICENSE="Apache-2.0"
SLOT="0"

RDEPEND="
app-containers/containers-image
app-containers/containers-storage
app-containers/containers-shortnames
net-firewall/nftables
net-firewall/iptables[nftables]
|| ( app-containers/crun app-containers/runc )
|| (
( >=app-containers/netavark-1.6.0 >=app-containers/aardvark-dns-1.6.0 )
>=app-containers/cni-plugins-0.9.1
)
"

BDEPEND="
>=dev-go/go-md2man-2.0.2
"

src_prepare() {
default

[[ -f docs/Makefile ]] || die
sed -i -e 's|/usr/local|/usr|g;' docs/Makefile || die

eapply "${FILESDIR}/fix-warnings.patch"
}

src_configure() {
return
}

src_compile() {
emake docs
}

src_test() {
return
}

src_install() {
emake DESTDIR="${D}" install

insinto /etc/containers
# https://github.com/containers/skopeo/raw/main/default-policy.json
doins pkg/config/containers.conf "${FILESDIR}/policy.json"

insinto /etc/containers/registries.d
# https://github.com/containers/skopeo/raw/main/default.yaml
doins "${FILESDIR}/default.yaml"

insinto /usr/share/containers
# https://github.com/containers/common/raw/main/pkg/seccomp/seccomp.json
# https://github.com/containers/common/raw/main/pkg/subscriptions/mounts.conf
doins "${FILESDIR}/seccomp.json" "${FILESDIR}/mounts.conf"

keepdir /etc/containers/certs.d /etc/containers/oci/hooks.d /etc/containers/systemd /var/lib/containers/sigstore
}
28 changes: 28 additions & 0 deletions app-containers/containers-common/files/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This is a default registries.d configuration file. You may
# add to this file or create additional files in registries.d/.
#
# lookaside: for reading/writing simple signing signatures
# lookaside-staging: for writing simple signing signatures, preferred over lookaside
#
# lookaside and lookaside-staging take a value of the following:
# lookaside: {schema}://location
#
# For reading signatures, schema may be http, https, or file.
# For writing signatures, schema may only be file.

# The default locations are built-in, for both reading and writing:
# /var/lib/containers/sigstore for root, or
# ~/.local/share/containers/sigstore for non-root users.
default-docker:
# lookaside: https://…
# lookaside-staging: file:///…

# The 'docker' indicator here is the start of the configuration
# for docker registries.
#
# docker:
#
# privateregistry.com:
# lookaside: https://privateregistry.com/sigstore/
# lookaside-staging: /mnt/nfs/privateregistry/sigstore

24 changes: 24 additions & 0 deletions app-containers/containers-common/files/fix-warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- a/Makefile
+++ b/Makefile
@@ -4,20 +4,5 @@
DESTDIR ?=
-PREFIX := /usr/local
+PREFIX := /usr
CONFIGDIR := ${PREFIX}/share/containers

-define go-build
- CGO_ENABLED=0 \
- GOOS=$(1) GOARCH=$(2) $(GO) build -tags "$(3)" ./...
-endef
-
-ifeq ($(shell uname -s),Linux)
-define go-build-c
- CGO_ENABLED=1 \
- GOOS=$(1) GOARCH=$(2) $(GO) build -tags "$(3)" ./...
-endef
-else
-define go-build-c
-endef
-endif
-
.PHONY:
3 changes: 3 additions & 0 deletions app-containers/containers-common/files/mounts.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Refer to containers-mounts.conf(5)
# Example:
# /usr/share/rhel/secrets:/run/secrets
14 changes: 14 additions & 0 deletions app-containers/containers-common/files/policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}

0 comments on commit 2941140

Please sign in to comment.