# Generated by rust2rpm 25 %bcond_without check Name: bpfman Version: 0.5.4 Release: %autorelease Summary: EBPF Program Manager # License tag must be an "AND" connected list of all licenses for statically linked components License: %{shrink: Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND OpenSSL AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT AND BSD-3-Clause) AND (MIT OR Apache-2.0 OR BSD-1-Clause) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT) AND GPL-2.0-only AND GPL-2.0-only OR BSD-2-Clause } # License breakdown for specific files: # # The following files are listed as being GPL-2.0-only: # - bpf/xdp_dispatcher_v1.bpf.c # - bpf/xdp_dispatcher_v2.bpf.c # - examples/go-xdp-counter/bpf/xdp_counter.c # # The following files are listed as being GPL-2.0-only OR BSD-2-Clause: # - bpf/tc_dispatcher.bpf.c # - examples/**/bpf/*.c # - tests/**/*.bpf.c # LICENSE.dependencies contains a full license breakdown URL: https://bpfman.io Source0: https://github.com/bpfman/bpfman/archive/refs/tags/v%{version}.tar.gz # References to code related to the p434 curve have been removed from the vendored sources in Source1 # In order to generate the vendored file run "cargo vendor --versioned dirs" # remove "fiat-crypto-0.2.9/src/p434.rs" and references to it # compress with "tar -Jcvf" Source1: https://dmellado.fedorapeople.org/bpfman/bpfman-%{version}-vendor.tar.xz BuildRequires: cargo-rpm-macros >= 25 BuildRequires: systemd-rpm-macros # dependency for the bundled openssl-sys crate BuildRequires: openssl-devel # dependency for the bundled libz-sys crate BuildRequires: pkgconfig(zlib) # dependency for the bundled cc crate BuildRequires: gcc %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-%{version} -p1 -a1 # License patches on the vendored directory upsets cargo when it tries to verify checksums in those files. # If we just truncate that file list, cargo won't have anything to complain about. find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' # Sometimes Rust sources start with #![...] attributes, and "smart" editors think # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' # Patch Cargo.toml for 'ring' to fix the license metadata sed -i 's/license-file = "LICENSE"/license = "ISC AND MIT AND OpenSSL"/' vendor/ring-0.17.8/Cargo.toml # Patch bpfman service fiile to be compliant with https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin sed -i 's|/usr/sbin/bpfman-rpc|/usr/bin/bpfman-rpc|' ./scripts/bpfman.service %cargo_prep -v vendor %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %{cargo_vendor_manifest} %install install -Dpm 0755 \ -t %{buildroot}%{_bindir} \ ./target/release/bpfman install -Dpm 0755 \ -t %{buildroot}%{_bindir} \ ./target/release/bpfman-ns install -Dpm 0755 \ -t %{buildroot}%{_bindir} \ ./target/release/bpfman-rpc install -Dpm 644 \ -t %{buildroot}%{_unitdir} \ ./scripts/bpfman.socket install -Dpm 644 \ -t %{buildroot}%{_unitdir} \ ./scripts/bpfman.service %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 %doc README.md %{_bindir}/bpfman %{_bindir}/bpfman-ns %{_bindir}/bpfman-rpc %{_unitdir}/bpfman.socket %{_unitdir}/bpfman.service %if %{with check} %check # Skip image_pull_* tests as require Internet to pull images from a registry %cargo_test -- -- --skip image_pull_ %endif %changelog %autochangelog