## START: Set by rpmautospec
## (rpmautospec version 0.7.2)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by rust2rpm 26
%bcond_without check
%global debug_package %{nil}

%global crate libbpf-sys
%global upstream_version 1.4.1+v1.4.0

Name:           rust-libbpf-sys
Version:        1.4.1
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}}
# Automatically generated patch to strip dependencies and normalize metadata
Patch:          libbpf-sys-fix-metadata-auto.diff

BuildRequires:  cargo-rpm-macros >= 24
BuildRequires:  elfutils-libelf-devel
BuildRequires:  kernel-headers
BuildRequires:  zlib-devel

%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
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
%license %{crate_instdir}/libbpf/LICENSE
%license %{crate_instdir}/libbpf/LICENSE.BSD-2-Clause
%license %{crate_instdir}/libbpf/LICENSE.LGPL-2.1
%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

%package     -n %{name}+bindgen-source-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+bindgen-source-devel %{_description}

This package contains library source intended for building other packages which
use the "bindgen-source" feature of the "%{crate}" crate.

%files       -n %{name}+bindgen-source-devel
%ghost %{crate_instdir}/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 %{crate_instdir}/Cargo.toml

%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

%package     -n %{name}+static-libbpf-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+static-libbpf-devel %{_description}

This package contains library source intended for building other packages which
use the "static-libbpf" feature of the "%{crate}" crate.

%files       -n %{name}+static-libbpf-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+static-libelf-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+static-libelf-devel %{_description}

This package contains library source intended for building other packages which
use the "static-libelf" feature of the "%{crate}" crate.

%files       -n %{name}+static-libelf-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+static-zlib-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+static-zlib-devel %{_description}

This package contains library source intended for building other packages which
use the "static-zlib" feature of the "%{crate}" crate.

%files       -n %{name}+static-zlib-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+vendored-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+vendored-devel %{_description}

This package contains library source intended for building other packages which
use the "vendored" feature of the "%{crate}" crate.

%files       -n %{name}+vendored-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+vendored-libbpf-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+vendored-libbpf-devel %{_description}

This package contains library source intended for building other packages which
use the "vendored-libbpf" feature of the "%{crate}" crate.

%files       -n %{name}+vendored-libbpf-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+vendored-libelf-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+vendored-libelf-devel %{_description}

This package contains library source intended for building other packages which
use the "vendored-libelf" feature of the "%{crate}" crate.

%files       -n %{name}+vendored-libelf-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+vendored-zlib-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+vendored-zlib-devel %{_description}

This package contains library source intended for building other packages which
use the "vendored-zlib" feature of the "%{crate}" crate.

%files       -n %{name}+vendored-zlib-devel
%ghost %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{upstream_version} -p1
rm -rf elfutils zlib
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
## START: Generated by rpmautospec
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun May 19 2024 Michel Lind <salimma@fedoraproject.org> - 1.4.1-1
- Update to 1.4.1 (rhbz#2260404)

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Aug 02 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.2.1-1
- Update to 1.2.1

* Thu Jul 27 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-8
- Always use vendored libbpf for consistency

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jan 30 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-6
- Only declare providing the bundled libbpf if we're vendoring
- restore deleting the bundled libbpf if defaulting to novendor

* Mon Jan 30 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-5
- Unify spec so novendor is toggled based on Fedora release version

* Fri Jan 27 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-4
- Switch back to vendored libbpf, as the system one is too old

* Thu Jan 19 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-3
- Fix FTI for bindgen feature by bumping the bindgen requirement to 0.63

* Fri Dec 09 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-2
- Restore the removal of the bundled libbpf

* Thu Dec 08 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.4-1
- Update to 1.0.4

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1~2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Feb 15 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.6.1~2-1
- Update to 0.6.1~2 (resolves: rhbz#2028922)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0~2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Nov 11 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.5.0~2-1
- Update to 0.5.0~2; Fixes: RHBZ#2012618

* Thu Oct 14 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.5.0~1-1
- Update to 0.5.0~1; Fixes: RHBZ#2012618

* Thu Jul 29 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.4.0~2-1
- Update to 0.4.0~2; Fixes: RHBZ#1980903

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0~1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.4.0~1-1
- Update to 0.4.0~1

* Mon May 10 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.3.0~2-1
- Update to 0.3.0~2
- Drop redundant Requires for subpackages

* Mon May 10 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.3.0~1-3
- Backport PR#18 and turn the novendor feature on by default

* Sun May 09 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.3.0~1-2
- Install license
- Unbundle libbpf and use the system one instead
- Add missing Requires to devel subpackages

* Fri May 07 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.3.0~1-1
- Initial package

## END: Generated by rpmautospec