You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-libbpf-cargo/rust-libbpf-cargo.spec

124 lines
2.9 KiB

# Generated by rust2rpm 23
4 years ago
%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
4 years ago
Summary: Cargo plugin to build bpf programs
License: LGPL-2.1 OR BSD-2-Clause
4 years ago
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
4 years ago
BuildRequires: rust-packaging >= 21
4 years ago
%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
4 years ago
%doc README.md
%{_bindir}/cargo-libbpf
%package devel
Summary: %{summary}
BuildArch: noarch
Requires: clang
Requires: rustfmt
4 years ago
%description devel %{_description}
This package contains library source intended for building other packages which
use the "%{crate}" crate.
4 years ago
%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}/
4 years ago
%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.
4 years ago
%files -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml
4 years ago
%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
4 years ago
%prep
%autosetup -n %{crate}-%{version_no_tilde} -N
%autopatch -p1 -M 100
%if %{with novendor}
%autopatch -p1 -m 101
%endif
4 years ago
%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'
4 years ago
%build
%cargo_build
%install
%cargo_install
%if %{with check}
%check
%cargo_test
4 years ago
%endif
%changelog
%autochangelog