%define debug %nil %define debug_package %{nil} %define _libexecdir %{_prefix}/libexec %define rustver 1.80.0 #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 Name: netavark Version: 1.14.0 Release: 1 License: ASL 2.0 & BSD-3-Clause & MIT 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 BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(openssl3.3) %if %{mdvver} > 201610 BuildRequires: rust >= 1.77.0 BuildRequires: cargo %endif Recommends: aardvark-dns %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 tar -xf %{SOURCE1} mkdir -p $HOME/.cargo cat >$HOME/.cargo/config << EOF [source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "$PWD/vendor" EOF %build 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' %if %{mdvver} <= 201610 source "$HOME/.cargo/env" %endif %make %make PREFIX=%{_prefix} docs %install %makeinstall DESTDIR=%{buildroot} PREFIX=%{_prefix} SYSTEMDDIR=%{_unitdir} %post %systemd_post %{name}-dhcp-proxy.service %systemd_post %{name}-firewalld-reload.service %preun %systemd_preun %{name}-dhcp-proxy.service %systemd_preun %{name}-firewalld-reload.service %postun %systemd_postun_with_restart %{name}-dhcp-proxy.service %systemd_postun_with_restart %{name}-firewalld-reload.service %files %doc README.md LICENSE %{_libexecdir}/podman/%{name}* %{_mandir}/man1/%{name}.1* %{_mandir}/man7/netavark-firewalld.7* %{_unitdir}/%{name}-dhcp-proxy.service %{_unitdir}/%{name}-dhcp-proxy.socket %{_unitdir}/%{name}-firewalld-reload.service %changelog