1- # Below definitions are used to deliver config files from a particular branch
2- # of c/image, c/storage and c/shortnames vendored in all of Buildah, Podman and Skopeo.
3- # These vendored components must have the same version. If it is not the case,
4- # pick the oldest version on c/image, c/storage and c/shortnames vendored in
5- # Buildah/Podman/Skopeo.
6-
7- # Packit will automatically update the image and storage versions on Fedora and
8- # CentOS Stream dist-git PRs.
9- %global image_branch main
10- %global storage_branch main
11- %global shortnames_branch main
12-
131%global project containers
14- %global repo common
15-
16- %global raw_github_url https://raw.githubusercontent.com/%{project }
2+ %global repo container-libs
173
184%if %{defined copr_username }
195%define copr_build 1
@@ -35,7 +21,7 @@ Epoch: 5
3521%endif
3622# DO NOT TOUCH the Version string!
3723# The TRUE source of this specfile is:
38- # https://github.com/containers/common /blob/main/rpm/containers-common.spec
24+ # https://github.com/containers/container-libs /blob/main/common /rpm/containers-common.spec
3925# If that's what you're reading, Version must be 0, and will be updated by Packit for
4026# copr and koji builds.
4127# If you're reading this on dist-git, the version is automatically filled in by Packit.
@@ -57,25 +43,12 @@ Requires: (fuse-overlayfs if fedora-release-identity-server)
5743Suggests: fuse-overlayfs
5844%endif
5945URL: https://github.com/%{project }/%{repo }
60- Source0: %{url }/archive/v%{version_no_tilde }.tar.gz
61- Source1: %{raw_github_url }/image/%{image_branch }/docs/containers-auth.json.5.md
62- Source2: %{raw_github_url }/image/%{image_branch }/docs/containers-certs.d.5.md
63- Source3: %{raw_github_url }/image/%{image_branch }/docs/containers-policy.json.5.md
64- Source4: %{raw_github_url }/image/%{image_branch }/docs/containers-registries.conf.5.md
65- Source5: %{raw_github_url }/image/%{image_branch }/docs/containers-registries.conf.d.5.md
66- Source6: %{raw_github_url }/image/%{image_branch }/docs/containers-registries.d.5.md
67- Source7: %{raw_github_url }/image/%{image_branch }/docs/containers-signature.5.md
68- Source8: %{raw_github_url }/image/%{image_branch }/docs/containers-transports.5.md
69- Source9: %{raw_github_url }/storage/%{storage_branch }/docs/containers-storage.conf.5.md
70- Source10: %{raw_github_url }/shortnames/%{shortnames_branch }/shortnames.conf
71- Source11: %{raw_github_url }/image/%{image_branch }/default.yaml
72- Source12: %{raw_github_url }/image/%{image_branch }/default-policy.json
73- Source13: %{raw_github_url }/image/%{image_branch }/registries.conf
74- Source14: %{raw_github_url }/storage/%{storage_branch }/storage.conf
46+ Source0: %{url }/archive/refs/tags/common/v%{version }.tar.gz
47+ Source1: https://raw.githubusercontent.com/containers/shortnames/refs/heads/main/shortnames.conf
7548# Fetch RPM-GPG-KEY-redhat-release from the authoritative source instead of storing
7649# a copy in repo or dist-git. Depending on distribution-gpg-keys rpm is also
7750# not an option because that package doesn't exist on CentOS Stream.
78- Source15 : https://access.redhat.com/security/data/fd431d51.txt
51+ Source2 : https://access.redhat.com/security/data/fd431d51.txt
7952
8053%description
8154This package contains common configuration files and documentation for container
@@ -109,34 +82,16 @@ This subpackage will handle dependencies common to Podman and Buildah which are
10982not required by Skopeo.
11083
11184%prep
112- %autosetup -Sgit -n %{repo }-%{version_no_tilde }
113-
114- # Copy manpages to docs subdir in builddir to build before installing.
115- cp %{SOURCE1 } docs/.
116- cp %{SOURCE2 } docs/.
117- cp %{SOURCE3 } docs/.
118- cp %{SOURCE4 } docs/.
119- cp %{SOURCE5 } docs/.
120- cp %{SOURCE6 } docs/.
121- cp %{SOURCE7 } docs/.
122- cp %{SOURCE8 } docs/.
123- cp %{SOURCE9 } docs/.
124-
125- # Copy config files to builddir to patch them before installing.
126- # Currently, only registries.conf and storage.conf files are patched before
127- # installing.
128- cp %{SOURCE10 } shortnames.conf
129- cp %{SOURCE13 } registries.conf
130- cp %{SOURCE14 } storage.conf
85+ %autosetup -Sgit -n %{repo }-common-v%{version }
13186
13287# Fine-grain distro- and release-specific tuning of config files,
13388# e.g., seccomp, composefs, registries on different RHEL/Fedora versions
134- bash rpm/update-config-files.sh
89+ bash common/ rpm/update-config-files.sh
13590
13691%build
13792mkdir -p man5
138- for i in docs/* .5.md; do
139- go-md2man -in $i -out man5/$( basename $i .md)
93+ for i in common/docs/ * .5.md image/docs/ * .5.md storage/ docs/* .5.md; do
94+ go-md2man -in $i -out man5/$( basename $i .md)
14095done
14196
14297%install
@@ -150,32 +105,31 @@ touch %{buildroot}%{_prefix}/lib/containers/storage/overlay-images/images.lock
150105install -dp -m 700 %{buildroot }%{_prefix }/lib/containers/storage/overlay-layers
151106touch %{buildroot }%{_prefix }/lib/containers/storage/overlay-layers/layers.lock
152107
153- install -Dp -m0644 shortnames.conf %{buildroot }%{_sysconfdir }/containers/registries.conf.d/000-shortnames.conf
154- install -Dp -m0644 %{ SOURCE11 } %{buildroot }%{_sysconfdir }/containers/registries.d/default.yaml
155- install -Dp -m0644 %{ SOURCE12 } %{buildroot }%{_sysconfdir }/containers/policy.json
156- install -Dp -m0644 registries.conf %{buildroot }%{_sysconfdir }/containers/registries.conf
157- install -Dp -m0644 storage.conf %{buildroot }%{_datadir }/containers/storage.conf
108+ install -Dp -m0644 %{ SOURCE1 } %{buildroot }%{_sysconfdir }/containers/registries.conf.d/000-shortnames.conf
109+ install -Dp -m0644 image/default.yaml %{buildroot }%{_sysconfdir }/containers/registries.d/default.yaml
110+ install -Dp -m0644 image/default-policy.json %{buildroot }%{_sysconfdir }/containers/policy.json
111+ install -Dp -m0644 image/ registries.conf %{buildroot }%{_sysconfdir }/containers/registries.conf
112+ install -Dp -m0644 storage/storage .conf %{buildroot }%{_datadir }/containers/storage.conf
158113
159114# RPM-GPG-KEY-redhat-release already exists on rhel envs, install only on
160115# fedora and centos
161116%if %{defined fedora } || %{defined centos }
162- install -Dp -m0644 %{SOURCE15 } %{buildroot }%{_sysconfdir }/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
117+ install -Dp -m0644 %{SOURCE2 } %{buildroot }%{_sysconfdir }/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
163118%endif
164119
165- install -Dp -m0644 contrib/redhat/registry.access.redhat.com.yaml -t %{buildroot }%{_sysconfdir }/containers/registries.d
166- install -Dp -m0644 contrib/redhat/registry.redhat.io.yaml -t %{buildroot }%{_sysconfdir }/containers/registries.d
120+ install -Dp -m0644 common/ contrib/redhat/registry.access.redhat.com.yaml -t %{buildroot }%{_sysconfdir }/containers/registries.d
121+ install -Dp -m0644 common/ contrib/redhat/registry.redhat.io.yaml -t %{buildroot }%{_sysconfdir }/containers/registries.d
167122
168123# install manpages
169- install -dp %{buildroot }%{_mandir }/man5
170124for i in man5/*.5; do
171- install -Dp -m0644 $i -t %{buildroot }%{_mandir }/man5
125+ install -Dp -m0644 $i -t %{buildroot }%{_mandir }/man5
172126done
173127ln -s containerignore.5 %{buildroot }%{_mandir }/man5/.containerignore.5
174128
175129# install config files for mounts, containers and seccomp
176- install -m0644 pkg/subscriptions/mounts.conf %{buildroot }%{_datadir }/containers/mounts.conf
177- install -m0644 pkg/seccomp/seccomp.json %{buildroot }%{_datadir }/containers/seccomp.json
178- install -m0644 pkg/config/containers.conf %{buildroot }%{_datadir }/containers/containers.conf
130+ install -m0644 common/ pkg/subscriptions/mounts.conf %{buildroot }%{_datadir }/containers/mounts.conf
131+ install -m0644 common/ pkg/seccomp/seccomp.json %{buildroot }%{_datadir }/containers/seccomp.json
132+ install -m0644 common/ pkg/config/containers.conf %{buildroot }%{_datadir }/containers/containers.conf
179133
180134# install secrets patch directory
181135install -d -p -m 755 %{buildroot }/%{_datadir }/rhel/secrets
0 commit comments