# Generated by rust2rpm 25 %bcond_without check %global gitdate 20240313 %global commit a11dd61c1ccc492451df0efc6a019e1856330f60 %global shortcommit a11dd61 Name: bpfman Version: 0.4.0 Release: %autorelease -p -s %{gitdate}git%{shortcommit} Summary: EBPF Program Manager SourceLicense: Apache-2.0 # (Apache-2.0 OR MIT) AND BSD-3-Clause # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR ISC OR MIT # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause OR Apache-2.0 OR MIT # BSD-3-Clause # ISC # MIT # MIT AND BSD-3-Clause # MIT OR Apache-2.0 # MIT OR Apache-2.0 OR BSD-1-Clause # MIT OR Apache-2.0 OR Zlib # MIT OR Zlib OR Apache-2.0 # MPL-2.0 # Unlicense OR MIT # Zlib OR Apache-2.0 OR MIT License: Apache-2.0 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Apache-2.0 OR ISC OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR BSD-1-Clause) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016 # LICENSE.dependencies contains a full license breakdown URL: https://bpfman.io Source: https://github.com/bpfman/bpfman/archive/%{commit}/%{name}-%{shortcommit}.tar.gz # To create the vendor tarball, extract Source0 and run rust2rpm wiht correct params: # rust2rpm -V bpfman/bpfman/ 0.4.0 && mv bpfman/bpfman-0.4.0-vendor.tar.xz bpfman/bpfman-0.4.0-vendor-a11dd61.tar.xz #Source: bpfman-0.4.0-vendor-%%{shortcommit}.tar.xz # Uploading vendor tarball to public server for review process, the tarball should be uploaded using fedpkg new-sources Source: https://dmellado.fedorapeople.org/bpfman/bpfman-0.4.0-vendor-%{shortcommit}.tar.xz BuildRequires: cargo-rpm-macros >= 25 BuildRequires: systemd-rpm-macros BuildRequires: openssl-devel %global _description %{expand: bpfman operates as an eBPF manager, focusing on simplifying the deployment and administration of eBPF programs.} %description %{_description} %prep %autosetup -n bpfman-%{commit} -p1 -a1 # Replace the Git Dependency on Aya with a path dependency # TODO: This will be removed when we do an upstream Aya release sed -i 's#aya = { git = "https://github.com/aya-rs/aya", branch = "main" }#aya = { path = "vendor/aya-0.11.0" }#g' Cargo.toml # Let the macros setup Cargo.toml to use vendored sources # Link versioned aya-obj to non-versioned to satisfy aya's requirement pushd vendor && ln -s aya-obj-0.1.0 aya-obj && popd %cargo_prep -v vendor %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %{cargo_vendor_manifest} %install # We can't use %%cargo_install here because it does not support setting --path install -Dpm 0755 -t %{buildroot}%{_sbindir} ./target/release/bpfman install -Dpm 0644 -t %{buildroot}%{_unitdir} ./scripts/bpfman.service %if %{with check} %check # Skip image_pull_* tests as require Internet to pull images from a registry %cargo_test -- -- --skip oci_utils::image_manager::tests::image_pull_failure \ --skip oci_utils::image_manager::tests::image_pull_and_bytecode_verify \ --skip oci_utils::image_manager::tests::private_image_pull_and_bytecode_verify \ --skip oci_utils::image_manager::tests::image_pull_policy_never_failure %endif %post %systemd_post bpfman.service %preun %systemd_preun bpfman.service %postun %systemd_postun_with_restart bpfman.service %files %license LICENSE-APACHE %license LICENSE.dependencies %license cargo-vendor.txt %{_sbindir}/bpfman %{_unitdir}/bpfman.service %changelog %autochangelog