# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} %global crate rbpf Name: rust-rbpf Version: 0.4.0 Release: %autorelease Summary: Virtual machine and JIT compiler for eBPF programs # Upstream license specification: Apache-2.0/MIT License: Apache-2.0 OR MIT URL: https://crates.io/crates/rbpf Source: %{crates_source} # Manually created patch for downstream crate metadata changes Patch: rbpf-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Virtual machine and JIT compiler for eBPF programs.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE-APACHE %license %{crate_instdir}/LICENSE-MIT %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}+cranelift-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+cranelift-devel %{_description} This package contains library source intended for building other packages which use the "cranelift" feature of the "%{crate}" crate. %files -n %{name}+cranelift-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+std-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+std-devel %{_description} This package contains library source intended for building other packages which use the "std" feature of the "%{crate}" crate. %files -n %{name}+std-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check # Skip doctests: JIT tests crash in mock (no executable memory) # On non-x86_64, also skip x86_64-specific JIT tests (misc, ubpf_jit_x86_64) # On s390x, also skip ubpf_vm tests due to upstream endianness bugs %ifarch x86_64 %cargo_test -- --lib --tests %elifarch s390x # s390x is big-endian; ubpf_vm tests have endianness bugs (upstream issue) %cargo_test -- --lib --test assembler --test common --test cranelift --test disassembler --test ubpf_verifier %else # Exclude tests that contain x86_64 JIT code (SIGILL on other arches) %cargo_test -- --lib --test assembler --test common --test cranelift --test disassembler --test ubpf_verifier --test ubpf_vm %endif %endif %changelog %autochangelog