2024-04-12 22:06:21 +03:00
|
|
|
%define debug %nil
|
|
|
|
%define debug_package %{nil}
|
|
|
|
%define _libexecdir %{_prefix}/libexec
|
2024-10-29 21:38:38 +00:00
|
|
|
%define rustver 1.80.0
|
2024-04-13 22:58:59 +00:00
|
|
|
|
|
|
|
#define __cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' %{_bindir}/cargo
|
2024-04-12 22:06:21 +03:00
|
|
|
|
|
|
|
Name: netavark
|
2025-02-10 15:15:23 +00:00
|
|
|
Version: 1.14.0
|
2024-04-12 22:06:21 +03:00
|
|
|
Release: 1
|
2024-04-13 22:58:59 +00:00
|
|
|
License: ASL 2.0 & BSD-3-Clause & MIT
|
2024-04-12 22:06:21 +03:00
|
|
|
Summary: OCI network stack
|
|
|
|
URL: https://github.com/containers/%{name}
|
|
|
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
|
Source1: %{url}/releases/download/v%{version}/%{name}-v%{version}-vendor.tar.gz
|
|
|
|
Group: Development/Other
|
|
|
|
BuildRequires: go-md2man
|
|
|
|
#Provides: container-network-stack = 2
|
|
|
|
BuildRequires: make
|
|
|
|
BuildRequires: curl
|
|
|
|
BuildRequires: protobuf-c
|
|
|
|
BuildRequires: protobuf-compiler
|
|
|
|
BuildRequires: git-core
|
2024-04-12 22:24:08 +03:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2024-10-29 21:38:38 +00:00
|
|
|
BuildRequires: pkgconfig(openssl3.3)
|
2024-04-12 22:06:21 +03:00
|
|
|
%if %{mdvver} > 201610
|
2024-04-13 22:58:59 +00:00
|
|
|
BuildRequires: rust >= 1.77.0
|
|
|
|
BuildRequires: cargo
|
2024-04-12 22:06:21 +03:00
|
|
|
%endif
|
2024-04-13 22:58:59 +00:00
|
|
|
Recommends: aardvark-dns
|
2024-04-12 22:06:21 +03:00
|
|
|
|
|
|
|
%description
|
|
|
|
%{summary}
|
|
|
|
|
|
|
|
Netavark is a rust based network stack for containers. It is
|
|
|
|
being designed to work with Podman but is also applicable
|
|
|
|
for other OCI container management applications.
|
|
|
|
|
|
|
|
Netavark is a tool for configuring networking for Linux
|
|
|
|
containers.
|
|
|
|
Its features include:
|
|
|
|
* Configuration of container networks via JSON configuration
|
|
|
|
file
|
|
|
|
* Creation and management of required network interfaces,
|
|
|
|
including MACVLAN networks
|
|
|
|
* All required firewall configuration to perform NAT and port
|
|
|
|
forwarding as required for containers
|
|
|
|
* Support for iptables and firewalld at present, with support
|
|
|
|
for nftables planned in a future release
|
|
|
|
* Support for rootless containers
|
|
|
|
* Support for IPv4 and IPv6
|
|
|
|
* Support for container DNS resolution via aardvark-dns.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
%if %{mdvver} <= 201610
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |\
|
|
|
|
sh -s -- -y --profile default --default-toolchain %{rustver}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2024-04-13 22:58:59 +00:00
|
|
|
tar -xf %{SOURCE1}
|
|
|
|
mkdir -p $HOME/.cargo
|
2024-04-12 22:06:21 +03:00
|
|
|
|
2024-04-13 22:58:59 +00:00
|
|
|
cat >$HOME/.cargo/config << EOF
|
2024-04-12 22:06:21 +03:00
|
|
|
[source.crates-io]
|
|
|
|
replace-with = "vendored-sources"
|
|
|
|
|
|
|
|
[source.vendored-sources]
|
2024-04-13 22:58:59 +00:00
|
|
|
directory = "$PWD/vendor"
|
2024-04-12 22:06:21 +03:00
|
|
|
EOF
|
|
|
|
|
|
|
|
%build
|
2024-04-13 22:58:59 +00:00
|
|
|
export CARGO_HOME=$HOME/.cargo
|
|
|
|
export RUSTC_BOOTSTRAP=1
|
|
|
|
export RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn'
|
|
|
|
|
|
|
|
|
2024-04-12 22:06:21 +03:00
|
|
|
%if %{mdvver} <= 201610
|
|
|
|
source "$HOME/.cargo/env"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%make
|
2024-04-13 22:58:59 +00:00
|
|
|
%make PREFIX=%{_prefix} docs
|
2024-04-12 22:06:21 +03:00
|
|
|
|
|
|
|
%install
|
2024-04-13 22:58:59 +00:00
|
|
|
%makeinstall DESTDIR=%{buildroot} PREFIX=%{_prefix} SYSTEMDDIR=%{_unitdir}
|
|
|
|
|
|
|
|
%post
|
|
|
|
%systemd_post %{name}-dhcp-proxy.service
|
|
|
|
%systemd_post %{name}-firewalld-reload.service
|
2024-04-12 22:06:21 +03:00
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun %{name}-dhcp-proxy.service
|
|
|
|
%systemd_preun %{name}-firewalld-reload.service
|
|
|
|
|
|
|
|
%postun
|
2024-04-13 22:58:59 +00:00
|
|
|
%systemd_postun_with_restart %{name}-dhcp-proxy.service
|
|
|
|
%systemd_postun_with_restart %{name}-firewalld-reload.service
|
|
|
|
|
2024-04-12 22:06:21 +03:00
|
|
|
|
|
|
|
%files
|
2024-04-13 22:58:59 +00:00
|
|
|
%doc README.md LICENSE
|
2024-04-12 22:06:21 +03:00
|
|
|
%{_libexecdir}/podman/%{name}*
|
|
|
|
%{_mandir}/man1/%{name}.1*
|
2025-02-11 08:03:37 +00:00
|
|
|
%{_mandir}/man7/netavark-firewalld.7*
|
2024-04-12 22:06:21 +03:00
|
|
|
%{_unitdir}/%{name}-dhcp-proxy.service
|
|
|
|
%{_unitdir}/%{name}-dhcp-proxy.socket
|
|
|
|
%{_unitdir}/%{name}-firewalld-reload.service
|
|
|
|
|
|
|
|
%changelog
|