# Generated by rust2rpm 23 %bcond_without check %global crate libbpf-cargo %if 0%{?fedora} == 38 # Fedora 38's libbpf is new enough # currently: 1.1.0 %bcond_without novendor %else %bcond_with novendor %endif Name: rust-libbpf-cargo Version: 0.13.1 Release: %autorelease Summary: Cargo plugin to build bpf programs License: LGPL-2.1 OR BSD-2-Clause URL: https://crates.io/crates/libbpf-cargo Source: %{crates_source} # Manually created patch for downstream crate metadata changes # - bump cargo_metadata to 0.15 # - bump goblin to 0.5 Patch: libbpf-cargo-fix-metadata.diff # by default, test.rs expects libbpf-rs to be in the same checkout # fix to point to /usr/share/cargo/registry Patch: libbpf-cargo-fix-finding-libbpf-rs.diff # Conditional patch for defaulting to novendor Patch101: libbpf-cargo-default-to-novendor.diff BuildRequires: rust-packaging >= 21 %global _description %{expand: Cargo plugin to build bpf programs.} %description %{_description} %package -n %{crate} Summary: %{summary} %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE %license LICENSE.BSD-2-Clause %license LICENSE.LPGL-2.1 %doc README.md %{_bindir}/cargo-libbpf %package devel Summary: %{summary} BuildArch: noarch Requires: clang Requires: rustfmt %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %license %{crate_instdir}/LICENSE.BSD-2-Clause %license %{crate_instdir}/LICENSE.LPGL-2.1 %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %if %{with novendor} %package -n %{name}+novendor-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+novendor-devel %{_description} This package contains library source intended for building other packages which use the "novendor" feature of the "%{crate}" crate. %files -n %{name}+novendor-devel %ghost %{crate_instdir}/Cargo.toml %endif %prep %autosetup -n %{crate}-%{version_no_tilde} -N %autopatch -p1 -M 100 %if %{with novendor} %autopatch -p1 -m 101 %endif %cargo_prep %generate_buildrequires %cargo_generate_buildrequires echo 'clang' # this was dropped from Cargo.toml upstream with the expectation that # libbpf-rs is built from the same Git checkout echo 'crate(libbpf-rs) = 0.19.1' echo 'rustfmt' %build %cargo_build %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog