de7ddf
# Bellow definitions are used to deliver config files from a particular branch
de7ddf
# of c/image, c/common, c/storage vendored in all podman, skopeo, buildah.
de7ddf
# These vendored components must have the same version. If it is not the case,
de7ddf
# pick the oldest version on c/image, c/common, c/storage vendored in
de7ddf
# podman/skopeo/podman.
de7ddf
%global skopeo_branch v1.4.0
de7ddf
%global podman_branch v3.3-0-rc3
de7ddf
%global image_branch v5.15.2
de7ddf
%global common_branch v0.42.1
de7ddf
%global storage_branch v1.34.1
de7ddf
%global shortnames_branch main
de7ddf
de7ddf
Epoch: 2
de7ddf
Name: containers-common
de7ddf
Version: 1
de7ddf
Release: 2%{?dist}
de7ddf
Summary: Common configuration and documentation for containers
de7ddf
License: ASL 2.0
de7ddf
BuildArch: noarch
de7ddf
BuildRequires: go-md2man
de7ddf
Provides: skopeo-containers = %{epoch}:%{version}-%{release}
de7ddf
Requires: (container-selinux >= 2:2.162.1 if selinux-policy)
de7ddf
Requires: oci-runtime
de7ddf
%if 0%{?rhel} >= 9 || 0%{?fedora}
de7ddf
Requires: crun >= 0.19
de7ddf
%else
de7ddf
Requires: runc
de7ddf
%endif
de7ddf
Requires: system-release
de7ddf
Suggests: subscription-manager
de7ddf
Recommends: fuse-overlayfs
de7ddf
Recommends: slirp4netns
de7ddf
Source1: https://raw.githubusercontent.com/containers/storage/%{storage_branch}/storage.conf
de7ddf
Source2: https://raw.githubusercontent.com/containers/storage/%{storage_branch}/docs/containers-storage.conf.5.md
de7ddf
Source3: mounts.conf
de7ddf
Source4: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.conf.5.md
de7ddf
#Source5: https://raw.githubusercontent.com/containers/image/%%{image_branch}/registries.conf
de7ddf
Source5: registries.conf
de7ddf
Source6: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-policy.json.5.md
de7ddf
Source7: https://raw.githubusercontent.com/containers/common/main/pkg/seccomp/seccomp.json
de7ddf
Source8: https://raw.githubusercontent.com/containers/common/%{common_branch}/docs/containers-mounts.conf.5.md
de7ddf
Source9: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-signature.5.md
de7ddf
Source10: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-transports.5.md
de7ddf
Source11: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-certs.d.5.md
de7ddf
Source12: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.d.5.md
de7ddf
Source13: https://raw.githubusercontent.com/containers/common/%{common_branch}/pkg/config/containers.conf
de7ddf
Source14: https://raw.githubusercontent.com/containers/common/%{common_branch}/docs/containers.conf.5.md
de7ddf
Source15: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-auth.json.5.md
de7ddf
Source16: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.conf.d.5.md
de7ddf
Source17: https://raw.githubusercontent.com/containers/shortnames/%{shortnames_branch}/shortnames.conf
de7ddf
Source19: 001-rhel-shortnames-pyxis.conf
de7ddf
Source20: 002-rhel-shortnames-overrides.conf
de7ddf
Source21: RPM-GPG-KEY-redhat-release
de7ddf
Source22: registry.access.redhat.com.yaml
de7ddf
Source23: registry.redhat.io.yaml
de7ddf
#Source24: https://raw.githubusercontent.com/containers/skopeo/%%{skopeo_branch}/default-policy.json
de7ddf
Source24: default-policy.json
de7ddf
Source25: https://raw.githubusercontent.com/containers/skopeo/%{skopeo_branch}/default.yaml
de7ddf
# scripts used for synchronization with upstream and shortname generation
de7ddf
Source100: update.sh
de7ddf
Source101: update-vendored.sh
de7ddf
Source102: pyxis.sh
de7ddf
de7ddf
%description
de7ddf
This package contains common configuration files and documentation for container
de7ddf
tools ecosystem, such as Podman, Buildah and Skopeo.
de7ddf
de7ddf
It is required because the most of configuration files and docs come from projects
de7ddf
which are vendored into Podman, Buildah, Skopeo, etc. but they are not packaged
de7ddf
separately.
de7ddf
de7ddf
%prep
de7ddf
de7ddf
%build
de7ddf
de7ddf
%install
de7ddf
install -dp %{buildroot}%{_sysconfdir}/containers/{certs.d,oci/hooks.d,registries.d,registries.conf.d}
de7ddf
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/storage.conf
de7ddf
install -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/containers/registries.conf
de7ddf
install -m0644 %{SOURCE17} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
de7ddf
install -m0644 %{SOURCE19} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/001-rhel-shortnames.conf
de7ddf
install -m0644 %{SOURCE20} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/002-rhel-shortnames-overrides.conf
de7ddf
de7ddf
# for signature verification
de7ddf
%if !0%{?rhel} || 0%{?centos}
de7ddf
install -dp %{buildroot}%{_sysconfdir}/pki/rpm-gpg
de7ddf
install -m0644 %{SOURCE21} %{buildroot}%{_sysconfdir}/pki/rpm-gpg
de7ddf
%endif
de7ddf
install -dp %{buildroot}%{_sysconfdir}/containers/registries.d
de7ddf
install -m0644 %{SOURCE22} %{buildroot}%{_sysconfdir}/containers/registries.d
de7ddf
install -m0644 %{SOURCE23} %{buildroot}%{_sysconfdir}/containers/registries.d
de7ddf
install -m0644 %{SOURCE24} %{buildroot}%{_sysconfdir}/containers/policy.json
de7ddf
install -dp %{buildroot}%{_sharedstatedir}/containers/sigstore
de7ddf
install -m0644 %{SOURCE25} %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml
de7ddf
de7ddf
# for containers-common
de7ddf
install -dp %{buildroot}%{_mandir}/man5
de7ddf
go-md2man -in %{SOURCE2} -out %{buildroot}%{_mandir}/man5/containers-storage.conf.5
de7ddf
go-md2man -in %{SOURCE4} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.5
de7ddf
go-md2man -in %{SOURCE6} -out %{buildroot}%{_mandir}/man5/containers-policy.json.5
de7ddf
go-md2man -in %{SOURCE8} -out %{buildroot}%{_mandir}/man5/containers-mounts.conf.5
de7ddf
go-md2man -in %{SOURCE9} -out %{buildroot}%{_mandir}/man5/containers-signature.5
de7ddf
go-md2man -in %{SOURCE10} -out %{buildroot}%{_mandir}/man5/containers-transports.5
de7ddf
go-md2man -in %{SOURCE11} -out %{buildroot}%{_mandir}/man5/containers-certs.d.5
de7ddf
go-md2man -in %{SOURCE12} -out %{buildroot}%{_mandir}/man5/containers-registries.d.5
de7ddf
go-md2man -in %{SOURCE14} -out %{buildroot}%{_mandir}/man5/containers.conf.5
de7ddf
go-md2man -in %{SOURCE15} -out %{buildroot}%{_mandir}/man5/containers-auth.json.5
de7ddf
go-md2man -in %{SOURCE16} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.d.5
de7ddf
de7ddf
install -dp %{buildroot}%{_datadir}/containers
de7ddf
install -m0644 %{SOURCE3} %{buildroot}%{_datadir}/containers/mounts.conf
de7ddf
install -m0644 %{SOURCE7} %{buildroot}%{_datadir}/containers/seccomp.json
de7ddf
install -m0644 %{SOURCE13} %{buildroot}%{_datadir}/containers/containers.conf
de7ddf
de7ddf
# install secrets patch directory
de7ddf
install -d -p -m 755 %{buildroot}/%{_datadir}/rhel/secrets
de7ddf
# rhbz#1110876 - update symlinks for subscription management
de7ddf
ln -s %{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/rhel/secrets/etc-pki-entitlement
de7ddf
ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm
de7ddf
ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo
de7ddf
de7ddf
# ship preconfigured /etc/containers/registries.d/ files with containers-common - #1903813
de7ddf
cat <<EOF > %{buildroot}%{_sysconfdir}/containers/registries.d/registry.access.redhat.com.yaml
de7ddf
docker:
de7ddf
     registry.access.redhat.com:
de7ddf
         sigstore: https://access.redhat.com/webassets/docker/content/sigstore
de7ddf
EOF
de7ddf
de7ddf
cat <<EOF > %{buildroot}%{_sysconfdir}/containers/registries.d/registry.redhat.io.yaml
de7ddf
docker:
de7ddf
     registry.redhat.io:
de7ddf
         sigstore: https://registry.redhat.io/containers/sigstore
de7ddf
EOF
de7ddf
de7ddf
%files
de7ddf
%dir %{_sysconfdir}/containers
de7ddf
%dir %{_sysconfdir}/containers/certs.d
de7ddf
%dir %{_sysconfdir}/containers/registries.d
de7ddf
%{_sysconfdir}/containers/registries.d/registry.redhat.io.yaml
de7ddf
%{_sysconfdir}/containers/registries.d/registry.access.redhat.com.yaml
de7ddf
%dir %{_sysconfdir}/containers/oci
de7ddf
%dir %{_sysconfdir}/containers/oci/hooks.d
de7ddf
%dir %{_sysconfdir}/containers/registries.conf.d
de7ddf
%if !0%{?rhel} || 0%{?centos}
de7ddf
%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
de7ddf
%endif
de7ddf
%config(noreplace) %{_sysconfdir}/containers/policy.json
de7ddf
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
de7ddf
%config(noreplace) %{_sysconfdir}/containers/storage.conf
de7ddf
%config(noreplace) %{_sysconfdir}/containers/registries.conf
de7ddf
%config(noreplace) %{_sysconfdir}/containers/registries.conf.d/*.conf
de7ddf
%config(noreplace) %{_sysconfdir}/containers/registries.d/*.yaml
de7ddf
%ghost %{_sysconfdir}/containers/containers.conf
de7ddf
%dir %{_sharedstatedir}/containers/sigstore
de7ddf
%{_mandir}/man5/*
de7ddf
%dir %{_datadir}/containers
de7ddf
%{_datadir}/containers/mounts.conf
de7ddf
%{_datadir}/containers/seccomp.json
de7ddf
%{_datadir}/containers/containers.conf
de7ddf
%dir %{_datadir}/rhel/secrets
de7ddf
%{_datadir}/rhel/secrets/*
de7ddf
de7ddf
%changelog
de7ddf
* Fri Aug 20 2021 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:1-2
de7ddf
- bump configs to latest versions
de7ddf
- replace ubi9 references with ubi8
de7ddf
- Related: #1970747
de7ddf
de7ddf
* Wed Aug 11 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-1
de7ddf
- initial import
de7ddf
- Related: #1970747