2566c1
# Bellow definitions are used to deliver config files from a particular branch
2566c1
# of c/image, c/common, c/storage vendored in all podman, skopeo, buildah.
2566c1
# These vendored components must have the same version. If it is not the case,
2566c1
# pick the oldest version on c/image, c/common, c/storage vendored in
2566c1
# podman/skopeo/podman.
2566c1
%global skopeo_branch main
2566c1
%global image_branch v5.19.1
2566c1
%global common_branch v0.47.4
2566c1
%global storage_branch v1.38.2
2566c1
%global shortnames_branch main
2566c1
2566c1
Epoch: 2
2566c1
Name: containers-common
2566c1
Version: 1
54481b
Release: 35%{?dist}
2566c1
Summary: Common configuration and documentation for containers
2566c1
License: ASL 2.0
2566c1
BuildRequires: /usr/bin/go-md2man
2566c1
Provides: skopeo-containers = %{epoch}:%{version}-%{release}
54481b
Conflicts: %{name} <= 2:1-22
54481b
Obsoletes: %{name} <= 2:1-22
2566c1
Requires: (container-selinux >= 2:2.162.1 if selinux-policy)
2566c1
Requires: oci-runtime
2566c1
%if 0%{?rhel} >= 9 || 0%{?fedora}
2566c1
Requires: crun >= 0.19
2566c1
%else
2566c1
Requires: runc
2566c1
%endif
2566c1
Requires: system-release
2566c1
Suggests: subscription-manager
2566c1
Recommends: fuse-overlayfs
2566c1
Recommends: slirp4netns
2566c1
Source1: https://raw.githubusercontent.com/containers/storage/%{storage_branch}/storage.conf
2566c1
Source2: https://raw.githubusercontent.com/containers/storage/%{storage_branch}/docs/containers-storage.conf.5.md
2566c1
Source3: mounts.conf
2566c1
Source4: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.conf.5.md
2566c1
#Source5: https://raw.githubusercontent.com/containers/image/%%{image_branch}/registries.conf
2566c1
Source5: registries.conf
2566c1
Source6: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-policy.json.5.md
2566c1
Source7: https://raw.githubusercontent.com/containers/common/%{common_branch}/pkg/seccomp/seccomp.json
2566c1
Source8: https://raw.githubusercontent.com/containers/common/%{common_branch}/docs/containers-mounts.conf.5.md
2566c1
Source9: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-signature.5.md
2566c1
Source10: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-transports.5.md
2566c1
Source11: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-certs.d.5.md
2566c1
Source12: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.d.5.md
2566c1
Source13: https://raw.githubusercontent.com/containers/common/%{common_branch}/pkg/config/containers.conf
2566c1
Source14: https://raw.githubusercontent.com/containers/common/%{common_branch}/docs/containers.conf.5.md
2566c1
Source15: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-auth.json.5.md
2566c1
Source16: https://raw.githubusercontent.com/containers/image/%{image_branch}/docs/containers-registries.conf.d.5.md
2566c1
Source17: https://raw.githubusercontent.com/containers/shortnames/%{shortnames_branch}/shortnames.conf
2566c1
Source19: 001-rhel-shortnames-pyxis.conf
2566c1
Source20: 002-rhel-shortnames-overrides.conf
2566c1
Source21: RPM-GPG-KEY-redhat-release
2566c1
Source22: registry.access.redhat.com.yaml
2566c1
Source23: registry.redhat.io.yaml
2566c1
#Source24: https://raw.githubusercontent.com/containers/skopeo/%%{skopeo_branch}/default-policy.json
2566c1
Source24: default-policy.json
2566c1
Source25: https://raw.githubusercontent.com/containers/skopeo/%{skopeo_branch}/default.yaml
54481b
# FIXME: fix the branch once these are available via regular c/common branch
54481b
Source26: https://raw.githubusercontent.com/containers/common/main/docs/Containerfile.5.md
54481b
Source27: https://raw.githubusercontent.com/containers/common/main/docs/containerignore.5.md
54481b
2566c1
# scripts used for synchronization with upstream and shortname generation
2566c1
Source100: update.sh
2566c1
Source101: update-vendored.sh
2566c1
Source102: pyxis.sh
2566c1
54481b
%global aardvark_dns_version v1.0.3
54481b
#%%global aardvark_dns_branch v1.0.1-rhel
54481b
%global aardvark_dns_commit0 a92337b08fbd88c9eb10c1a5ebce2bf61aa59a7b
2566c1
%global aardvark_dns_shortcommit0 %(c=%{aardvark_dns_commit0}; echo ${c:0:7})
54481b
%if 0%{?aardvark_dns_branch:1}
54481b
Source200: https://github.com/containers/aardvark-dns/tarball/%{aardvark_dns_commit0}/%{aardvark_dns_branch}-%{aardvark_dns_shortcommit0}.tar.gz
54481b
%else
2566c1
Source200: https://github.com/containers/aardvark-dns/archive/%{aardvark_dns_commit0}/aardvark-dns-%{aardvark_dns_version}-%{aardvark_dns_shortcommit0}.tar.gz
54481b
%endif
54481b
Source201: https://github.com/containers/aardvark-dns/releases/download/%{aardvark_dns_version}/aardvark-dns-%{aardvark_dns_version}-vendor.tar.gz
2566c1
54481b
%global netavark_version v1.0.3
54481b
#%%global netavark_branch v1.0.1-rhel
54481b
%global netavark_commit0 ec7efb85ef90db4a14c07cb003b65491f7eb4edf
2566c1
%global netavark_shortcommit0 %(c=%{netavark_commit0}; echo ${c:0:7})
54481b
%if 0%{?netavark_branch:1}
54481b
Source300: https://github.com/containers/netavark/tarball/%{netavark_commit0}/%{netavark_branch}-%{netavark_shortcommit0}.tar.gz
54481b
%else
2566c1
Source300: https://github.com/containers/netavark/archive/%{netavark_commit0}/netavark-%{netavark_version}-%{netavark_shortcommit0}.tar.gz
54481b
%endif
54481b
Source301: https://github.com/containers/netavark/releases/download/%{netavark_version}/netavark-%{netavark_version}-vendor.tar.gz
2566c1
2566c1
%description
2566c1
This package contains common configuration files and documentation for container
2566c1
tools ecosystem, such as Podman, Buildah and Skopeo.
2566c1
2566c1
It is required because the most of configuration files and docs come from projects
2566c1
which are vendored into Podman, Buildah, Skopeo, etc. but they are not packaged
2566c1
separately.
2566c1
2566c1
%package -n aardvark-dns
54481b
Version: 1.0.1
54481b
Release: 35%{?dist}
2566c1
URL: https://github.com/containers/aardvark-dns
2566c1
Summary: Authoritative DNS server for A/AAAA container records
2566c1
License: ASL 2.0 and BSD and MIT
2566c1
BuildRequires: cargo
2566c1
BuildRequires: git-core
2566c1
BuildRequires: make
2566c1
BuildRequires: rust-srpm-macros
54481b
BuildRequires: rust-toolset
54481b
#ExclusiveArch: %%{rust_arches}
54481b
ExclusiveArch: aarch64 ppc64le s390x x86_64
2566c1
2566c1
%description -n aardvark-dns
2566c1
%{summary}
2566c1
2566c1
Forwards other request to configured resolvers.
2566c1
Read more about configuration in `src/backend/mod.rs`.
2566c1
2566c1
%package -n netavark
54481b
Version: 1.0.1
54481b
Release: 35%{?dist}
2566c1
URL: https://github.com/containers/netavark
2566c1
Summary: OCI network stack
2566c1
License: ASL 2.0 and BSD and MIT
2566c1
BuildRequires: cargo
2566c1
BuildRequires: make
2566c1
BuildRequires: rust-srpm-macros
2566c1
BuildRequires: git-core
2566c1
BuildRequires: /usr/bin/go-md2man
2566c1
Recommends: aardvark-dns
2566c1
Provides: container-network-stack = 2
54481b
BuildRequires: rust-toolset
54481b
#ExclusiveArch: #%%{rust_arches}
54481b
ExclusiveArch: aarch64 ppc64le s390x x86_64
2566c1
2566c1
%description -n netavark
2566c1
%{summary}
2566c1
2566c1
Netavark is a rust based network stack for containers. It is being
2566c1
designed to work with Podman but is also applicable for other OCI
2566c1
container management applications.
2566c1
2566c1
Netavark is a tool for configuring networking for Linux containers.
2566c1
Its features include:
2566c1
* Configuration of container networks via JSON configuration file
2566c1
* Creation and management of required network interfaces,
2566c1
    including MACVLAN networks
2566c1
* All required firewall configuration to perform NAT and port
2566c1
    forwarding as required for containers
2566c1
* Support for iptables and firewalld at present, with support
2566c1
    for nftables planned in a future release
2566c1
* Support for rootless containers
2566c1
* Support for IPv4 and IPv6
2566c1
* Support for container DNS resolution via aardvark-dns.
2566c1
2566c1
%prep
2566c1
tar fx %{SOURCE200}
54481b
pushd aardvark-dns-%{aardvark_dns_commit0}
54481b
tar fx %{SOURCE201}
54481b
mkdir -p .cargo
54481b
cat >.cargo/config << EOF
54481b
[source.crates-io]
54481b
replace-with = "vendored-sources"
54481b
54481b
[source.vendored-sources]
54481b
directory = "vendor"
54481b
EOF
54481b
popd
2566c1
tar fx %{SOURCE300}
54481b
pushd netavark-%{netavark_commit0}
54481b
tar fx %{SOURCE301}
54481b
mkdir -p .cargo
54481b
cat >.cargo/config << EOF
54481b
[source.crates-io]
54481b
replace-with = "vendored-sources"
54481b
54481b
[source.vendored-sources]
54481b
directory = "vendor"
54481b
EOF
54481b
popd
2566c1
2566c1
%build
54481b
%if 0%{?build_rustflags:1}
54481b
export RUSTFLAGS="%{build_rustflags}"
54481b
%endif
54481b
2566c1
pushd aardvark-dns-%{aardvark_dns_commit0}
2566c1
%__scm_setup_git -q
54481b
%make_build build
2566c1
popd
2566c1
2566c1
pushd netavark-%{netavark_commit0}
2566c1
%__scm_setup_git -q
54481b
%make_build build
2566c1
pushd docs
2566c1
go-md2man -in netavark.1.md -out netavark.1
2566c1
popd
2566c1
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install
2566c1
popd
2566c1
2566c1
%install
2566c1
pushd aardvark-dns-%{aardvark_dns_commit0}
2566c1
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install
2566c1
popd
2566c1
2566c1
pushd netavark-%{netavark_commit0}
2566c1
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install
2566c1
popd
2566c1
2566c1
install -dp %{buildroot}%{_sysconfdir}/containers/{certs.d,oci/hooks.d,registries.d,registries.conf.d}
2566c1
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/storage.conf
2566c1
install -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/containers/registries.conf
2566c1
install -m0644 %{SOURCE17} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf
2566c1
install -m0644 %{SOURCE19} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/001-rhel-shortnames.conf
2566c1
install -m0644 %{SOURCE20} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/002-rhel-shortnames-overrides.conf
2566c1
2566c1
# for signature verification
2566c1
%if !0%{?rhel} || 0%{?centos}
2566c1
install -dp %{buildroot}%{_sysconfdir}/pki/rpm-gpg
2566c1
install -m0644 %{SOURCE21} %{buildroot}%{_sysconfdir}/pki/rpm-gpg
2566c1
%endif
2566c1
install -dp %{buildroot}%{_sysconfdir}/containers/registries.d
2566c1
install -m0644 %{SOURCE22} %{buildroot}%{_sysconfdir}/containers/registries.d
2566c1
install -m0644 %{SOURCE23} %{buildroot}%{_sysconfdir}/containers/registries.d
2566c1
install -m0644 %{SOURCE24} %{buildroot}%{_sysconfdir}/containers/policy.json
2566c1
install -dp %{buildroot}%{_sharedstatedir}/containers/sigstore
2566c1
install -m0644 %{SOURCE25} %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml
2566c1
2566c1
# for containers-common
2566c1
install -dp %{buildroot}%{_mandir}/man5
2566c1
go-md2man -in %{SOURCE2} -out %{buildroot}%{_mandir}/man5/containers-storage.conf.5
2566c1
go-md2man -in %{SOURCE4} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.5
2566c1
go-md2man -in %{SOURCE6} -out %{buildroot}%{_mandir}/man5/containers-policy.json.5
2566c1
go-md2man -in %{SOURCE8} -out %{buildroot}%{_mandir}/man5/containers-mounts.conf.5
2566c1
go-md2man -in %{SOURCE9} -out %{buildroot}%{_mandir}/man5/containers-signature.5
2566c1
go-md2man -in %{SOURCE10} -out %{buildroot}%{_mandir}/man5/containers-transports.5
2566c1
go-md2man -in %{SOURCE11} -out %{buildroot}%{_mandir}/man5/containers-certs.d.5
2566c1
go-md2man -in %{SOURCE12} -out %{buildroot}%{_mandir}/man5/containers-registries.d.5
2566c1
go-md2man -in %{SOURCE14} -out %{buildroot}%{_mandir}/man5/containers.conf.5
2566c1
go-md2man -in %{SOURCE15} -out %{buildroot}%{_mandir}/man5/containers-auth.json.5
2566c1
go-md2man -in %{SOURCE16} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.d.5
54481b
go-md2man -in %{SOURCE26} -out %{buildroot}%{_mandir}/man5/Containerfile.5
54481b
go-md2man -in %{SOURCE27} -out %{buildroot}%{_mandir}/man5/containerignore.5
2566c1
2566c1
install -dp %{buildroot}%{_datadir}/containers
2566c1
install -m0644 %{SOURCE3} %{buildroot}%{_datadir}/containers/mounts.conf
2566c1
install -m0644 %{SOURCE7} %{buildroot}%{_datadir}/containers/seccomp.json
2566c1
install -m0644 %{SOURCE13} %{buildroot}%{_datadir}/containers/containers.conf
2566c1
2566c1
# install secrets patch directory
2566c1
install -d -p -m 755 %{buildroot}/%{_datadir}/rhel/secrets
2566c1
# rhbz#1110876 - update symlinks for subscription management
2566c1
ln -s %{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/rhel/secrets/etc-pki-entitlement
2566c1
ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm
2566c1
ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo
2566c1
2566c1
# ship preconfigured /etc/containers/registries.d/ files with containers-common - #1903813
2566c1
cat <<EOF > %{buildroot}%{_sysconfdir}/containers/registries.d/registry.access.redhat.com.yaml
2566c1
docker:
2566c1
     registry.access.redhat.com:
2566c1
         sigstore: https://access.redhat.com/webassets/docker/content/sigstore
2566c1
EOF
2566c1
2566c1
cat <<EOF > %{buildroot}%{_sysconfdir}/containers/registries.d/registry.redhat.io.yaml
2566c1
docker:
2566c1
     registry.redhat.io:
2566c1
         sigstore: https://registry.redhat.io/containers/sigstore
2566c1
EOF
2566c1
2566c1
%files
2566c1
%dir %{_sysconfdir}/containers
2566c1
%dir %{_sysconfdir}/containers/certs.d
2566c1
%dir %{_sysconfdir}/containers/registries.d
2566c1
%{_sysconfdir}/containers/registries.d/registry.redhat.io.yaml
2566c1
%{_sysconfdir}/containers/registries.d/registry.access.redhat.com.yaml
2566c1
%dir %{_sysconfdir}/containers/oci
2566c1
%dir %{_sysconfdir}/containers/oci/hooks.d
2566c1
%dir %{_sysconfdir}/containers/registries.conf.d
2566c1
%if !0%{?rhel} || 0%{?centos}
2566c1
%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
2566c1
%endif
2566c1
%config(noreplace) %{_sysconfdir}/containers/policy.json
2566c1
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
2566c1
%config(noreplace) %{_sysconfdir}/containers/storage.conf
2566c1
%config(noreplace) %{_sysconfdir}/containers/registries.conf
2566c1
%config(noreplace) %{_sysconfdir}/containers/registries.conf.d/*.conf
2566c1
%config(noreplace) %{_sysconfdir}/containers/registries.d/*.yaml
2566c1
%ghost %{_sysconfdir}/containers/containers.conf
2566c1
%dir %{_sharedstatedir}/containers/sigstore
2566c1
%{_mandir}/man5/*
2566c1
%dir %{_datadir}/containers
2566c1
%{_datadir}/containers/mounts.conf
2566c1
%{_datadir}/containers/seccomp.json
2566c1
%{_datadir}/containers/containers.conf
2566c1
%dir %{_datadir}/rhel/secrets
2566c1
%{_datadir}/rhel/secrets/*
2566c1
2566c1
%files -n aardvark-dns
2566c1
%license aardvark-dns-%{aardvark_dns_commit0}/LICENSE
2566c1
%dir %{_libexecdir}/podman
2566c1
%{_libexecdir}/podman/aardvark-dns
2566c1
2566c1
%files -n netavark
2566c1
%license netavark-%{netavark_commit0}/LICENSE
2566c1
%dir %{_libexecdir}/podman
2566c1
%{_libexecdir}/podman/netavark
2566c1
%{_mandir}/man1/netavark.1*
2566c1
2566c1
%changelog
54481b
* Wed Jul 13 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-35
54481b
- update vendored components and configuration files
54481b
- Related: #2061390
54481b
54481b
* Mon Jun 27 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-34
54481b
- update shortnames and be sure to remove rhel-els
54481b
- Related: #2061390
54481b
54481b
* Thu Jun 09 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-33
54481b
- additional fix for unqualified registries
54481b
- Related: #2061390
54481b
54481b
* Wed May 11 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-26
54481b
- update vendored components and configuration files
54481b
- Related: #2061390
54481b
54481b
* Fri Apr 01 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-25
54481b
- update vendored components and configuration files
54481b
- Related: #2061390
54481b
54481b
* Mon Feb 28 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-23
54481b
- update to netavark and aardvark-dns 1.0.1
54481b
- Related: #2001445
54481b
54481b
* Wed Feb 23 2022 Lokesh Mandvekar <lsm5@redhat.com> - 2:1-22
54481b
- build rust packages with RUSTFLAGS set to make ExecShield happy
54481b
- bump release tag by 3 for easier cherry-picking from rhel8 stream
54481b
- Related: #2001445
54481b
2566c1
* Mon Feb 21 2022 Lokesh Mandvekar <lsm5@redhat.com> - 2:1-19
2566c1
- do not specify infra_image in containers.conf
2566c1
- needed to resolve gating test failures
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Feb 18 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-18
2566c1
- update to netavark-1.0.0 and aardvark-dns-1.0.0
2566c1
- Related: #2001445
2566c1
2566c1
* Thu Feb 10 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-17
2566c1
- update vendored components and configuration files
2566c1
- Related: #2001445
2566c1
2566c1
* Thu Feb 10 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-16
2566c1
- sync vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Thu Feb 10 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-15
2566c1
- update vendored components and configuration files
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Feb 04 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-14
2566c1
- sync vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Feb 04 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-13
2566c1
- sync vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Jan 21 2022 Jindrich Novy <jnovy@redhat.com> - 2:1-12
2566c1
- update shortnames from Pyxis
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Dec 10 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-11
2566c1
- do not allow broken content from Pyxis to land in shortnames.conf
2566c1
- Related: #2001445
2566c1
2566c1
* Wed Dec 08 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-10
2566c1
- sync vendored components
2566c1
- update shortnames from Pyxis
2566c1
- Related: #2001445
2566c1
2566c1
* Wed Dec 01 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-9
2566c1
- use log_driver = "journald" and events_logger = "journald" for RHEL9
2566c1
- Related: #2001445
2566c1
2566c1
* Tue Nov 16 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-8
2566c1
- consume seccomp.json from the oldest vendored version of c/common,
2566c1
  not main branch
2566c1
- Related: #2001445
2566c1
2566c1
* Mon Nov 15 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-7
2566c1
- update vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Wed Oct 13 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-6
2566c1
- sync vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Wed Sep 29 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-5
2566c1
- update to the new vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Sep 24 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-4
2566c1
- update to the new vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Fri Sep 10 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-3
2566c1
- update to the new vendored components
2566c1
- Related: #2001445
2566c1
2566c1
* Wed Aug 11 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-2
2566c1
- synchronize config files for RHEL-8.5
2566c1
- Related: #1934415
2566c1
2566c1
* Wed Aug 11 2021 Jindrich Novy <jnovy@redhat.com> - 2:1-1
2566c1
- initial import
2566c1
- Related: #1934415