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

114 lines
2.7 KiB

# Generated by rust2rpm 20
4 years ago
%bcond_without check
%global crate libbpf-cargo
Name: rust-%{crate}
Version: 0.10.0
Release: %autorelease
4 years ago
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
4 years ago
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
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 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.
4 years ago
%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
4 years ago
%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
4 years ago
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
echo 'clang'
echo 'rust-libbpf-rs-devel'
echo 'rustfmt'
4 years ago
%build
%cargo_build
%install
%cargo_install
%if %{with check}
%check
%cargo_test
4 years ago
%endif
%changelog
%autochangelog