2018-02-15 13:23:04 +01:00
|
|
|
#
|
|
|
|
# spec file for package libcontainers-common
|
|
|
|
#
|
2023-02-20 17:50:06 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-02-15 13:23:04 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-09-05 13:46:19 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-02-15 13:23:04 +01:00
|
|
|
#
|
|
|
|
|
2020-10-18 16:18:12 +02:00
|
|
|
|
2020-07-30 09:58:12 +02:00
|
|
|
# commonver - version from containers/common
|
2024-04-12 10:46:31 +02:00
|
|
|
%define commonver 0.58.0
|
2019-01-30 11:43:13 +01:00
|
|
|
# storagever - version from containers/storage
|
2024-04-12 10:46:31 +02:00
|
|
|
%define storagever 1.53.0
|
2019-01-30 11:43:13 +01:00
|
|
|
# imagever - version from containers/image
|
2024-04-12 10:46:31 +02:00
|
|
|
%define imagever 5.30.0
|
2023-02-20 17:50:06 +01:00
|
|
|
# skopeover - version from containers/skopeo
|
2024-04-12 10:46:31 +02:00
|
|
|
%define skopeover 1.15.0
|
2023-02-20 17:50:06 +01:00
|
|
|
# https://github.com/containers/shortnames
|
|
|
|
%define shortnamesver 2023.02.20
|
2018-02-15 13:23:04 +01:00
|
|
|
Name: libcontainers-common
|
2024-04-12 10:46:31 +02:00
|
|
|
Version: 20240408
|
2018-02-15 13:23:04 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Configuration files common to github.com/containers
|
2023-02-20 17:50:06 +01:00
|
|
|
License: Apache-2.0
|
2018-02-15 13:23:04 +01:00
|
|
|
Group: System/Management
|
2018-09-05 13:46:19 +02:00
|
|
|
URL: https://github.com/containers
|
2019-01-30 11:43:13 +01:00
|
|
|
Source0: image-%{imagever}.tar.xz
|
|
|
|
Source1: storage-%{storagever}.tar.xz
|
2018-09-05 13:46:19 +02:00
|
|
|
Source2: LICENSE
|
2023-02-20 17:50:06 +01:00
|
|
|
# https://raw.githubusercontent.com/containers/skopeo/main/default-policy.json
|
|
|
|
Source3: https://raw.githubusercontent.com/containers/skopeo/v%{skopeover}/default-policy.json#./policy.json
|
|
|
|
# https://github.com/containers/storage/blob/main/storage.conf + custom changes
|
2019-02-04 15:33:02 +01:00
|
|
|
Source4: storage.conf
|
2023-02-20 17:50:06 +01:00
|
|
|
# heavily modified version of https://github.com/containers/common/blob/main/pkg/subscriptions/mounts.conf
|
2018-09-05 13:46:19 +02:00
|
|
|
Source5: mounts.conf
|
2023-02-20 17:50:06 +01:00
|
|
|
# https://raw.githubusercontent.com/containers/image/main/registries.conf with our own registries inserted
|
2018-09-05 13:46:19 +02:00
|
|
|
Source6: registries.conf
|
2023-02-20 17:50:06 +01:00
|
|
|
# https://github.com/containers/skopeo/blob/main/default.yaml but heavily modified
|
2022-11-25 13:09:20 +01:00
|
|
|
Source7: default.yaml
|
|
|
|
Source8: common-%{commonver}.tar.xz
|
2024-04-12 10:46:31 +02:00
|
|
|
Source9: https://raw.githubusercontent.com/containers/common/v%{commonver}/pkg/config/containers.conf
|
2022-11-25 13:09:20 +01:00
|
|
|
Source10: %{name}.rpmlintrc
|
2023-02-20 17:50:06 +01:00
|
|
|
Source11: https://raw.githubusercontent.com/containers/shortnames/v%{shortnamesver}/shortnames.conf
|
2023-06-05 16:24:44 +02:00
|
|
|
Source12: openSUSE-policy.json
|
2024-04-12 10:46:31 +02:00
|
|
|
Patch100: 0001-containers.conf-SUSE-clear-cni-config-dir-for-ALP.patch
|
2018-09-05 13:46:19 +02:00
|
|
|
BuildRequires: go-go-md2man
|
2022-11-25 13:09:20 +01:00
|
|
|
Requires(post): %{_bindir}/sed
|
2023-05-16 15:25:03 +02:00
|
|
|
# add SLE-specific mounts for only SLES systems
|
2024-02-08 09:03:20 +01:00
|
|
|
Requires: (libcontainers-sles-mounts if (product(SUSE_SLE) or product(SLE-Micro)))
|
2023-06-06 15:13:04 +02:00
|
|
|
Requires: libcontainers-policy >= %{version}
|
2023-06-27 07:28:17 +02:00
|
|
|
Suggests: (libcontainers-policy-openSUSE if openSUSE-release)
|
2024-05-03 08:55:41 +02:00
|
|
|
# Default to SUSE registry on SL Micro,
|
|
|
|
# keep SUSE, openSUSE and dockerhub registries otherwise.
|
|
|
|
# (jsc#SMO-376, jsc#PED-8289)
|
|
|
|
Requires: registries-conf >= %{version}
|
|
|
|
Suggests: (registries-conf-suse if (product(SL-Micro) or (product(SUSE_SLE) >= 15.5)))
|
|
|
|
Suggests: (registries-conf-default if openSUSE-release)
|
2021-07-02 13:26:44 +02:00
|
|
|
Provides: libcontainers-image = %{version}
|
|
|
|
Provides: libcontainers-storage = %{version}
|
|
|
|
Obsoletes: libcontainers-image < %{version}
|
|
|
|
Obsoletes: libcontainers-storage < %{version}
|
2018-09-05 13:46:19 +02:00
|
|
|
BuildArch: noarch
|
2018-02-15 13:23:04 +01:00
|
|
|
|
|
|
|
%description
|
2018-09-05 13:46:19 +02:00
|
|
|
Configuration files and manpages shared by tools that are based on the
|
|
|
|
github.com/containers libraries, such as Buildah, CRI-O, Podman and Skopeo.
|
2018-02-15 13:23:04 +01:00
|
|
|
|
2023-05-16 15:25:03 +02:00
|
|
|
%package -n libcontainers-sles-mounts
|
|
|
|
Summary: Default mounts for SLE distributions
|
|
|
|
|
|
|
|
%description -n libcontainers-sles-mounts
|
2024-04-26 09:02:18 +02:00
|
|
|
Ships a /etc/containers/mounts.conf with default mounts for SLE distributions
|
2023-05-16 15:25:03 +02:00
|
|
|
|
2023-06-05 16:24:44 +02:00
|
|
|
%package -n libcontainers-openSUSE-policy
|
2023-06-06 15:13:04 +02:00
|
|
|
Summary: Policy to enforce image verification for SLE BCI
|
|
|
|
Provides: libcontainers-policy = %{version}-%{release}
|
2023-06-05 16:24:44 +02:00
|
|
|
|
|
|
|
RemovePathPostfixes: .openSUSE
|
|
|
|
Conflicts: libcontainers-default-policy
|
|
|
|
|
|
|
|
%description -n libcontainers-openSUSE-policy
|
2023-06-06 15:13:04 +02:00
|
|
|
This package ships a /etc/containers/policy.json which enforces image verification for SLE BCI.
|
2023-06-05 16:24:44 +02:00
|
|
|
|
|
|
|
%package -n libcontainers-default-policy
|
2023-06-06 15:13:04 +02:00
|
|
|
Summary: Default containers policy.json
|
|
|
|
Provides: libcontainers-policy = %{version}-%{release}
|
2023-06-05 16:24:44 +02:00
|
|
|
|
|
|
|
RemovePathPostfixes: .default
|
|
|
|
Conflicts: libcontainers-openSUSE-policy
|
|
|
|
|
|
|
|
%description -n libcontainers-default-policy
|
2023-06-06 15:13:04 +02:00
|
|
|
This package ships the default /etc/containers/policy.json
|
2023-06-05 16:24:44 +02:00
|
|
|
|
2024-05-03 08:55:41 +02:00
|
|
|
%package -n registries-conf-suse
|
|
|
|
Summary: Defaults to SUSE Registry on SL Micro
|
|
|
|
Provides: registries-conf = %{version}-%{release}
|
|
|
|
RemovePathPostfixes: .suse
|
|
|
|
Conflicts: registries-conf-default
|
|
|
|
|
|
|
|
%description -n registries-conf-suse
|
2024-05-03 08:58:33 +02:00
|
|
|
Ships a modified registries.conf with registry.suse.com as the only unqualified search registry.
|
2024-05-03 08:55:41 +02:00
|
|
|
|
|
|
|
%package -n registries-conf-default
|
|
|
|
Summary: Add SUSE and openSUSE registries to be used to pull images along with dockerhub
|
|
|
|
Provides: registries-conf = %{version}-%{release}
|
|
|
|
RemovePathPostfixes: .default
|
|
|
|
Conflicts: registries-conf-suse
|
|
|
|
|
|
|
|
%description -n registries-conf-default
|
2024-05-03 08:58:33 +02:00
|
|
|
Ships the upstream registries.conf with registry.opensuse.org and registry.suse.com as additional unqualified search registries.
|
2024-04-26 08:59:22 +02:00
|
|
|
|
2018-02-15 13:23:04 +01:00
|
|
|
%prep
|
2024-04-12 10:46:31 +02:00
|
|
|
cp %{SOURCE9} .
|
|
|
|
# Apply CNI config on streams other than ALP (bsc#1213556)
|
|
|
|
# https://github.com/containers/podman/issues/19327
|
|
|
|
%if 0%{?suse_version} < 1600 && !0%{?is_opensuse}
|
|
|
|
%patch -P100 -p3
|
|
|
|
sed -e 's-@LIBEXECDIR@-%{_libexecdir}-g' -i %_builddir/containers.conf
|
|
|
|
%endif
|
|
|
|
|
2022-11-25 13:09:20 +01:00
|
|
|
%setup -q -Tcq -b0 -b1 -b8
|
2018-09-05 13:46:19 +02:00
|
|
|
# copy the LICENSE file in the build root
|
|
|
|
cp %{SOURCE2} .
|
2018-02-15 13:23:04 +01:00
|
|
|
|
|
|
|
%build
|
2018-09-05 13:46:19 +02:00
|
|
|
cd ..
|
|
|
|
# compile containers/image manpages
|
2019-01-30 11:43:13 +01:00
|
|
|
cd image-%{imagever}
|
2018-09-05 13:46:19 +02:00
|
|
|
for md in docs/*.md
|
|
|
|
do
|
2024-02-08 09:03:20 +01:00
|
|
|
go-md2man -in $md -out $md
|
2018-09-05 13:46:19 +02:00
|
|
|
done
|
|
|
|
rename '.5.md' '.5' docs/*
|
|
|
|
rename '.md' '.1' docs/*
|
|
|
|
cd ..
|
|
|
|
# compile containers/storage manpages
|
2019-01-30 11:43:13 +01:00
|
|
|
cd storage-%{storagever}
|
2019-07-22 12:17:10 +02:00
|
|
|
for md in docs/*.md
|
2018-09-05 13:46:19 +02:00
|
|
|
do
|
2024-02-08 09:03:20 +01:00
|
|
|
go-md2man -in $md -out $md
|
2018-09-05 13:46:19 +02:00
|
|
|
done
|
|
|
|
rename '.5.md' '.5' docs/*
|
2019-07-22 12:17:10 +02:00
|
|
|
rename '.md' '.1' docs/*
|
2018-09-05 13:46:19 +02:00
|
|
|
cd ..
|
2022-11-25 13:09:20 +01:00
|
|
|
# compile subset of containers/common manpages
|
|
|
|
cd common-%{commonver}
|
2018-11-26 10:12:24 +01:00
|
|
|
go-md2man -in pkg/hooks/docs/oci-hooks.5.md -out pkg/hooks/docs/oci-hooks.5
|
|
|
|
cd ..
|
2018-02-15 13:23:04 +01:00
|
|
|
|
2023-05-16 15:25:03 +02:00
|
|
|
# These would only be used on SLE-systems
|
|
|
|
# via libcontainers-sles-mounts subpackage
|
2021-03-29 18:21:19 +02:00
|
|
|
cat >>%{SOURCE5} <<EOL
|
2022-11-25 13:09:20 +01:00
|
|
|
%{_sysconfdir}/SUSEConnect:%{_sysconfdir}/SUSEConnect
|
|
|
|
%{_sysconfdir}/zypp/credentials.d/SCCcredentials:%{_sysconfdir}/zypp/credentials.d/SCCcredentials
|
2021-03-29 18:21:19 +02:00
|
|
|
EOL
|
|
|
|
|
2024-05-03 08:55:41 +02:00
|
|
|
# Default to SUSE registry on SL Micro
|
|
|
|
sed 's/unqualified-search-registries.*/unqualified-search-registries = \["registry.suse.com"\]/' %{SOURCE6} > registries.conf.suse
|
|
|
|
|
2020-07-30 09:58:12 +02:00
|
|
|
cd common-%{commonver}
|
2022-11-25 13:09:20 +01:00
|
|
|
%make_build docs
|
2020-07-30 09:58:12 +02:00
|
|
|
cd ..
|
|
|
|
|
2018-02-15 13:23:04 +01:00
|
|
|
%install
|
2018-09-05 13:46:19 +02:00
|
|
|
cd ..
|
2018-02-15 13:23:04 +01:00
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/containers
|
2018-04-17 11:09:20 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/containers/oci/hooks.d
|
2018-09-05 13:46:19 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_datadir}/containers/oci/hooks.d
|
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/containers/registries.d
|
2022-08-05 14:52:03 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/containers/registries.conf.d
|
2023-04-28 10:04:32 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_sysconfdir}/containers/systemd
|
|
|
|
install -d -m 0755 %{buildroot}/%{_datadir}/containers/systemd
|
2018-09-05 13:46:19 +02:00
|
|
|
|
2023-06-05 16:24:44 +02:00
|
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/containers/policy.json.default
|
|
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/containers/policy.json.openSUSE
|
2019-02-04 15:33:02 +01:00
|
|
|
install -D -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/containers/storage.conf
|
2018-09-05 13:46:19 +02:00
|
|
|
install -D -m 0644 %{SOURCE5} %{buildroot}/%{_datadir}/containers/mounts.conf
|
|
|
|
install -D -m 0644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/containers/mounts.conf
|
2022-11-25 13:09:20 +01:00
|
|
|
install -D -m 0644 %{SOURCE11} %{buildroot}/%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
|
|
|
|
install -D -m 0644 %{SOURCE7} %{buildroot}/%{_sysconfdir}/containers/registries.d/default.yaml
|
2024-04-12 10:46:31 +02:00
|
|
|
install -D -m 0644 %_builddir/containers.conf %{buildroot}/%{_datadir}/containers/containers.conf
|
2021-01-19 15:59:37 +01:00
|
|
|
install -D -m 0644 common-%{commonver}/pkg/seccomp/seccomp.json %{buildroot}/%{_datadir}/containers/seccomp.json
|
|
|
|
install -D -m 0644 common-%{commonver}/pkg/seccomp/seccomp.json %{buildroot}/%{_sysconfdir}/containers/seccomp.json
|
2018-09-05 13:46:19 +02:00
|
|
|
|
|
|
|
install -d %{buildroot}/%{_mandir}/man1
|
|
|
|
install -d %{buildroot}/%{_mandir}/man5
|
2019-01-30 11:43:13 +01:00
|
|
|
install -D -m 0644 image-%{imagever}/docs/*.1 %{buildroot}/%{_mandir}/man1/
|
2019-07-22 12:17:10 +02:00
|
|
|
install -D -m 0644 image-%{imagever}/docs/*.5 %{buildroot}/%{_mandir}/man5/
|
|
|
|
install -D -m 0644 storage-%{storagever}/docs/*.1 %{buildroot}/%{_mandir}/man1/
|
2019-01-30 11:43:13 +01:00
|
|
|
install -D -m 0644 storage-%{storagever}/docs/*.5 %{buildroot}/%{_mandir}/man5/
|
2022-11-25 13:09:20 +01:00
|
|
|
install -D -m 0644 common-%{commonver}/pkg/hooks/docs/oci-hooks.5 %{buildroot}/%{_mandir}/man5/
|
2021-09-30 23:43:00 +02:00
|
|
|
install -D -m 0644 common-%{commonver}/docs/containers-mounts.conf.5 %{buildroot}/%{_mandir}/man5/
|
2020-07-30 09:58:12 +02:00
|
|
|
install -D -m 0644 common-%{commonver}/docs/containers.conf.5 %{buildroot}/%{_mandir}/man5/
|
2019-01-30 11:43:13 +01:00
|
|
|
|
2024-03-21 06:40:01 +01:00
|
|
|
install -D -m 0644 %{SOURCE12} %{buildroot}/%{_sysconfdir}/containers/policy.json.openSUSE
|
2023-06-05 16:24:44 +02:00
|
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/containers/policy.json.default
|
|
|
|
|
2024-05-03 08:55:41 +02:00
|
|
|
install -D -m 0644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/containers/registries.conf.default
|
|
|
|
install -D -m 0644 registries.conf.suse %{buildroot}/%{_sysconfdir}/containers/registries.conf.suse
|
2024-04-26 08:59:22 +02:00
|
|
|
|
2019-01-30 11:43:13 +01:00
|
|
|
%post
|
2021-09-21 21:12:27 +02:00
|
|
|
# Comment out ostree_repo if it's blank [boo#1189893]
|
2022-11-25 13:09:20 +01:00
|
|
|
sed -i 's/ostree_repo = ""/\#ostree_repo = ""/g' %{_sysconfdir}/containers/storage.conf
|
2018-02-15 13:23:04 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%dir %{_sysconfdir}/containers
|
2018-04-17 11:09:20 +02:00
|
|
|
%dir %{_sysconfdir}/containers/oci
|
|
|
|
%dir %{_sysconfdir}/containers/oci/hooks.d
|
2018-09-05 13:46:19 +02:00
|
|
|
%dir %{_sysconfdir}/containers/registries.d
|
2022-08-05 14:52:03 +02:00
|
|
|
%dir %{_sysconfdir}/containers/registries.conf.d
|
2023-04-28 10:04:32 +02:00
|
|
|
%dir %{_sysconfdir}/containers/systemd
|
2018-09-05 13:46:19 +02:00
|
|
|
%dir %{_datadir}/containers
|
|
|
|
%dir %{_datadir}/containers/oci
|
|
|
|
%dir %{_datadir}/containers/oci/hooks.d
|
2023-04-28 10:04:32 +02:00
|
|
|
%dir %{_datadir}/containers/systemd
|
2018-09-05 13:46:19 +02:00
|
|
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/storage.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/seccomp.json
|
2019-08-10 23:44:05 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
|
2022-08-05 14:52:03 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
|
2018-09-05 13:46:19 +02:00
|
|
|
%{_datadir}/containers/seccomp.json
|
2020-07-30 09:58:12 +02:00
|
|
|
%{_datadir}/containers/containers.conf
|
2018-09-05 13:46:19 +02:00
|
|
|
|
|
|
|
%{_mandir}/man1/*.1%{?ext_man}
|
|
|
|
%{_mandir}/man5/*.5%{?ext_man}
|
|
|
|
%license LICENSE
|
2018-02-15 13:23:04 +01:00
|
|
|
|
2023-05-16 15:25:03 +02:00
|
|
|
%files -n libcontainers-sles-mounts
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/mounts.conf
|
|
|
|
%{_datadir}/containers/mounts.conf
|
|
|
|
|
2023-06-05 16:24:44 +02:00
|
|
|
%files -n libcontainers-openSUSE-policy
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/policy.json.openSUSE
|
|
|
|
|
|
|
|
%files -n libcontainers-default-policy
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/policy.json.default
|
|
|
|
|
2024-05-03 08:55:41 +02:00
|
|
|
%files -n registries-conf-suse
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.conf.suse
|
|
|
|
|
|
|
|
%files -n registries-conf-default
|
|
|
|
%config(noreplace) %{_sysconfdir}/containers/registries.conf.default
|
|
|
|
|
2019-02-04 15:33:02 +01:00
|
|
|
%changelog
|