# Generated by rust2rpm 23 %bcond_without check %global debug_package %{nil} %global crate libbpf-sys %global upstream_version 1.0.4+v1.0.1 # default to vendored libbpf # otherwise we have to keep reasoning about if the system libbpf is new enough %bcond_with novendor Name: rust-libbpf-sys Version: 1.0.4 Release: %autorelease Summary: Rust bindings to libbpf from the Linux kernel License: BSD-2-Clause URL: https://crates.io/crates/libbpf-sys Source: %{crates_source %{crate} %{upstream_version}} # Manually created patch for downstream crate metadata changes # * remove version suffix from crate version # * bump bindgen to 0.63 Patch: libbpf-sys-fix-metadata.diff # Conditional patch for defaulting to novendor Patch101: libbpf-sys-default-to-novendor.diff BuildRequires: rust-packaging >= 21 %if %{without novendor} # the system libbpf is too old, use the bundled copy Provides: bundled(libbpf) = 1.0.1 %endif %global _description %{expand: Rust bindings to libbpf from the Linux kernel.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch Requires: elfutils-libelf-devel Requires: kernel-headers %if %{with novendor} Requires: libbpf-devel %endif Requires: zlib-devel %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %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 %package -n %{name}+bindgen-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+bindgen-devel %{_description} This package contains library source intended for building other packages which use the "bindgen" feature of the "%{crate}" crate. %files -n %{name}+bindgen-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 %package -n %{name}+static-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+static-devel %{_description} This package contains library source intended for building other packages which use the "static" feature of the "%{crate}" crate. %files -n %{name}+static-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{upstream_version} -N %autopatch -p1 -M 100 %if %{with novendor} %autopatch -p1 -m 101 rm -rf libbpf %endif %cargo_prep %generate_buildrequires %cargo_generate_buildrequires echo 'elfutils-libelf-devel' echo 'kernel-headers' %if %{with novendor} echo 'libbpf-devel' %endif echo 'zlib-devel' %build %cargo_build %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog