Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app-containers/containers-{common,storage}: with stable & live of deps #32976

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the whitespace so it's like:

DESCRIPTION
HOMEPAGE
SRC_URI

LICENSE
SLOT
BDEPEND
...

src_prepare() {

}

...

This roughly matches skel.ebuild.

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"}]
}
}
}