|
|
|
# Generated by rust2rpm 20
|
|
|
|
%bcond_without check
|
|
|
|
|
|
|
|
%global crate libbpf-cargo
|
|
|
|
|
|
|
|
Name: rust-%{crate}
|
|
|
|
Version: 0.10.0
|
|
|
|
Release: %autorelease
|
|
|
|
Summary: Cargo plugin to build bpf programs
|
|
|
|
|
|
|
|
# Upstream license specification: LGPL-2.1 OR BSD-2-Clause
|
|
|
|
License: LGPLv2 or BSD
|
|
|
|
URL: https://crates.io/crates/libbpf-cargo
|
|
|
|
Source: %{crates_source}
|
|
|
|
# * turn on the novendor feature by default
|
|
|
|
# * bump scroll and scroll_derive from 0.10 to 0.11,
|
|
|
|
# * bump goblin from 0.2 to 0.5:
|
|
|
|
# https://github.com/libbpf/libbpf-rs/commit/56608e0
|
|
|
|
Patch0: libbpf-cargo-fix-metadata.diff
|
|
|
|
# Fix finding libbpf-rs
|
|
|
|
Patch1: libbpf-cargo-fix-finding-libbpf-rs.patch
|
|
|
|
|
|
|
|
ExclusiveArch: %{rust_arches}
|
|
|
|
|
|
|
|
BuildRequires: rust-packaging
|
|
|
|
|
|
|
|
%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.BSD-2-Clause 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 LICENSE LICENSE.BSD-2-Clause LICENSE.LPGL-2.1
|
|
|
|
%doc README.md
|
|
|
|
%{cargo_registry}/%{crate}-%{version_no_tilde}/
|
|
|
|
|
|
|
|
%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 %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
|
|
|
|
|
|
|
%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 %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
|
|
|
%if 0%{?fedora} < 36
|
|
|
|
sed -i -e 's/version = "0.6.0-1"/version = "0.4.0-2"/' Cargo.toml
|
|
|
|
%else
|
|
|
|
%if 0%{?fc36}
|
|
|
|
sed -i -e 's/version = "0.6.0-1"/version = "0.5.0-2"/' Cargo.toml
|
|
|
|
%else
|
|
|
|
sed -i -e 's/version = "0.6.0-1"/version = "0.6.1-2"/' Cargo.toml
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%cargo_prep
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%cargo_generate_buildrequires
|
|
|
|
echo 'clang'
|
|
|
|
echo 'rust-libbpf-rs-devel'
|
|
|
|
echo 'rustfmt'
|
|
|
|
|
|
|
|
%build
|
|
|
|
%cargo_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%cargo_install
|
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
%check
|
|
|
|
%cargo_test
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
%autochangelog
|