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