132 lines
6.2 KiB
RPMSpec
132 lines
6.2 KiB
RPMSpec
|
|
# Below definitions are used to deliver config files from a particular branch
|
||
|
|
# of c/image, c/common, c/storage vendored in all of Buildah, Podman and Skopeo.
|
||
|
|
# These vendored components must have the same version. If it is not the case,
|
||
|
|
# pick the oldest version on c/image, c/common, c/storage vendored in
|
||
|
|
# Buildah/Podman/Skopeo.
|
||
|
|
%global skopeo_branch v1.2.3
|
||
|
|
%global podman_branch v3.2.0
|
||
|
|
%global image_branch v5.12.0
|
||
|
|
%global common_branch v0.39.0
|
||
|
|
%global storage_branch v1.32.2
|
||
|
|
%global shortnames_branch main
|
||
|
|
|
||
|
|
%global github_containers https://raw.githubusercontent.com/containers
|
||
|
|
|
||
|
|
Epoch: 4
|
||
|
|
Name: containers-common
|
||
|
|
Version: 1
|
||
|
|
Release: 1
|
||
|
|
Summary: Common configuration and documentation for containers.URL:https://github.com/containers/common
|
||
|
|
License: ASL 2.0
|
||
|
|
BuildArch: noarch
|
||
|
|
BuildRequires: go
|
||
|
|
Requires: container-selinux
|
||
|
|
Requires: oci-runtime
|
||
|
|
Recommends: fuse-overlayfs
|
||
|
|
Recommends: slirp4netns
|
||
|
|
Provides: skopeo-containers = %{epoch}:%{version}-%{release}
|
||
|
|
Obsoletes: %{name} <= 1:1.2.1-28
|
||
|
|
Source0: https://github.com/cpuguy83/go-md2man/archive/v1.0.10.tar.gz
|
||
|
|
Source1: %{github_containers}/common/%{common_branch}/docs/containers.conf.5.md
|
||
|
|
Source2: %{github_containers}/common/%{common_branch}/pkg/config/containers.conf
|
||
|
|
Source3: %{github_containers}/common/%{common_branch}/pkg/seccomp/seccomp.json
|
||
|
|
Source4: %{github_containers}/common/%{common_branch}/pkg/subscriptions/mounts.conf
|
||
|
|
Source5: %{github_containers}/image/%{image_branch}/docs/containers-auth.json.5.md
|
||
|
|
Source6: %{github_containers}/image/%{image_branch}/docs/containers-certs.d.5.md
|
||
|
|
Source7: %{github_containers}/image/%{image_branch}/docs/containers-policy.json.5.md
|
||
|
|
Source8: %{github_containers}/image/%{image_branch}/docs/containers-registries.conf.5.md
|
||
|
|
Source9: %{github_containers}/image/%{image_branch}/docs/containers-registries.conf.d.5.md
|
||
|
|
Source10: %{github_containers}/image/%{image_branch}/docs/containers-registries.d.5.md
|
||
|
|
Source11: %{github_containers}/image/%{image_branch}/docs/containers-signature.5.md
|
||
|
|
Source12: %{github_containers}/image/%{image_branch}/docs/containers-transports.5.md
|
||
|
|
Source13: %{github_containers}/image/%{image_branch}/registries.conf
|
||
|
|
Source14: %{github_containers}/podman/%{podman_branch}/docs/source/markdown/containers-mounts.conf.5.md
|
||
|
|
Source15: %{github_containers}/shortnames/%{shortnames_branch}/shortnames.conf
|
||
|
|
Source16: %{github_containers}/skopeo/%{skopeo_branch}/default.yaml
|
||
|
|
Source17: %{github_containers}/skopeo/%{skopeo_branch}/default-policy.json
|
||
|
|
Source18: %{github_containers}/storage/%{storage_branch}/docs/containers-storage.conf.5.md
|
||
|
|
Source19: %{github_containers}/storage/%{storage_branch}/storage.conf
|
||
|
|
|
||
|
|
%description
|
||
|
|
This package contains common configuration files and documentation for container
|
||
|
|
tools ecosystem, such as Podman, Buildah and Skopeo.
|
||
|
|
|
||
|
|
It is required because the most of configuration files and docs come from projects
|
||
|
|
which are vendored into Podman, Buildah, Skopeo, etc. but they are not packaged
|
||
|
|
separately.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
tar -xf %SOURCE0
|
||
|
|
|
||
|
|
%build
|
||
|
|
GO_MD2MAN_PATH="$(pwd)%{_bindir}"
|
||
|
|
mkdir -p _build/bin $GO_MD2MAN_PATH
|
||
|
|
cd go-md2man-*
|
||
|
|
go build -mod=vendor -o ../_build/bin/go-md2man .
|
||
|
|
cp ../_build/bin/go-md2man $GO_MD2MAN_PATH/go-md2man
|
||
|
|
export PATH=$GO_MD2MAN_PATH:$PATH
|
||
|
|
cd -
|
||
|
|
|
||
|
|
mkdir -p man5
|
||
|
|
for FILE in $(ls *.5.md); do
|
||
|
|
go-md2man -in $FILE -out man5/$(basename $FILE .md)
|
||
|
|
done
|
||
|
|
|
||
|
|
%install
|
||
|
|
# install config and policy files for registries
|
||
|
|
install -dp %{buildroot}%{_sysconfdir}/containers/{certs.d,oci/hooks.d,registries.conf.d,registries.d}
|
||
|
|
install -dp %{buildroot}%{_sharedstatedir}/containers/sigstore
|
||
|
|
install -m0644 %{_sourcedir}/default.yaml %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml
|
||
|
|
install -m0644 %{_sourcedir}/storage.conf %{buildroot}%{_sysconfdir}/containers/storage.conf
|
||
|
|
install -m0644 %{_sourcedir}/registries.conf %{buildroot}%{_sysconfdir}/containers/registries.conf
|
||
|
|
install -m0644 %{_sourcedir}/shortnames.conf %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
|
||
|
|
install -m0644 %{_sourcedir}/default-policy.json %{buildroot}%{_sysconfdir}/containers/policy.json
|
||
|
|
|
||
|
|
# install manpages
|
||
|
|
for FILE in $(ls -a man5 | grep 5); do
|
||
|
|
install -Dp -m0644 man5/$FILE -t %{buildroot}%{_mandir}/man5
|
||
|
|
done
|
||
|
|
|
||
|
|
# install config files for mounts, containers and seccomp
|
||
|
|
install -dp %{buildroot}%{_datadir}/containers
|
||
|
|
install -m0644 %{_sourcedir}/mounts.conf %{buildroot}%{_datadir}/containers/mounts.conf
|
||
|
|
install -m0644 %{_sourcedir}/seccomp.json %{buildroot}%{_datadir}/containers/seccomp.json
|
||
|
|
install -m0644 %{_sourcedir}/containers.conf %{buildroot}%{_datadir}/containers/containers.conf
|
||
|
|
|
||
|
|
# install secrets patch directory
|
||
|
|
install -d -p -m 755 %{buildroot}/%{_datadir}/openEuler/secrets
|
||
|
|
ln -s %{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/openEuler/secrets/etc-pki-entitlement
|
||
|
|
ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/openEuler/secrets/rhsm
|
||
|
|
ln -s %{_sysconfdir}/yum.repos.d/openEuler.repo %{buildroot}%{_datadir}/openEuler/secrets/openEuler.repo
|
||
|
|
|
||
|
|
%post
|
||
|
|
if [[ $1 == 1 ]]; then
|
||
|
|
if ! grep ^short-name-mode.*= %{_sysconfdir}/containers/registries.conf > /dev/null; then
|
||
|
|
echo 'short-name-mode="enforcing"' >> %{_sysconfdir}/containers/registries.conf
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
|
||
|
|
%files
|
||
|
|
%dir %{_sysconfdir}/containers
|
||
|
|
%dir %{_sysconfdir}/containers/certs.d
|
||
|
|
%dir %{_sysconfdir}/containers/oci
|
||
|
|
%dir %{_sysconfdir}/containers/oci/hooks.d
|
||
|
|
%dir %{_sysconfdir}/containers/registries.conf.d
|
||
|
|
%dir %{_sysconfdir}/containers/registries.d
|
||
|
|
%config(noreplace) %{_sysconfdir}/containers/policy.json
|
||
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.conf
|
||
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
|
||
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
|
||
|
|
%config(noreplace) %{_sysconfdir}/containers/storage.conf
|
||
|
|
%ghost %{_sysconfdir}/containers/containers.conf
|
||
|
|
%dir %{_sharedstatedir}/containers/sigstore
|
||
|
|
%dir %{_datadir}/containers
|
||
|
|
%{_datadir}/containers/containers.conf
|
||
|
|
%{_datadir}/containers/mounts.conf
|
||
|
|
%{_datadir}/containers/seccomp.json
|
||
|
|
%dir %{_datadir}/openEuler/secrets
|
||
|
|
%{_datadir}/openEuler/secrets/*
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Mon Mar 21 2022 fushanqing <fushanqing@kylinos.cn> - 4:1-1
|
||
|
|
- Init package
|