commit e6418a31af6c9f1571419794718ec6243fd57766 Author: tigro Date: Mon Jan 15 21:43:32 2024 +0300 import rust-libbpf-cargo-0.22.0-2.el9 diff --git a/.rust-libbpf-cargo.metadata b/.rust-libbpf-cargo.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/libbpf-cargo-0.22.0.crate b/SOURCES/libbpf-cargo-0.22.0.crate new file mode 100644 index 0000000..051ef64 Binary files /dev/null and b/SOURCES/libbpf-cargo-0.22.0.crate differ diff --git a/SOURCES/libbpf-cargo-fix-finding-libbpf-rs.diff b/SOURCES/libbpf-cargo-fix-finding-libbpf-rs.diff new file mode 100644 index 0000000..e3d528b --- /dev/null +++ b/SOURCES/libbpf-cargo-fix-finding-libbpf-rs.diff @@ -0,0 +1,18 @@ +--- a/src/test.rs ++++ b/src/test.rs +@@ -108,14 +108,7 @@ fn validate_bpf_o(path: &Path) { + + /// Returns the path to the local libbpf-rs + fn get_libbpf_rs_path() -> PathBuf { +- // The `CARGO_MANIFEST_DIR` environment variable points to the +- // libbpf-cargo directory, at build time. +- let libcargo_dir = env!("CARGO_MANIFEST_DIR"); +- +- Path::new(&libcargo_dir) +- .parent() +- .expect("failed to get parent of libbpf-cargo directory") +- .join("libbpf-rs") ++ Path::new("/usr/share/cargo/registry/libbpf-rs-0.22.0") + .canonicalize() + .expect("failed to canonicalize libbpf-rs") + } diff --git a/SPECS/rust-libbpf-cargo.spec b/SPECS/rust-libbpf-cargo.spec new file mode 100644 index 0000000..8a8501c --- /dev/null +++ b/SPECS/rust-libbpf-cargo.spec @@ -0,0 +1,203 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.5) +## 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 25 +%bcond_without check + +%global crate libbpf-cargo + +Name: rust-libbpf-cargo +Version: 0.22.0 +Release: %autorelease +Summary: Cargo plugin to build bpf programs + +License: LGPL-2.1-only OR BSD-2-Clause +URL: https://crates.io/crates/libbpf-cargo +Source: %{crates_source} +# 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 + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +Cargo plugin to build bpf programs.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 OR BSL-1.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# BSD-2-Clause +# BSD-3-Clause OR MIT OR Apache-2.0 +# LGPL-2.1-only OR BSD-2-Clause +# MIT +# MIT OR Apache-2.0 +License: (LGPL-2.1-only OR BSD-2-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-3-Clause OR MIT OR Apache-2.0) AND MIT +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.BSD-2-Clause +%license LICENSE.LGPL-2.1 +%license LICENSE.dependencies +%doc CHANGELOG.md +%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 %{crate_instdir}/LICENSE +%license %{crate_instdir}/LICENSE.BSD-2-Clause +%license %{crate_instdir}/LICENSE.LGPL-2.1 +%doc %{crate_instdir}/CHANGELOG.md +%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}+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 + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires +echo 'clang' +echo 'rustfmt' + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Mon Jan 15 2024 Arkady L. Shane - 0.22.0-2 +- Rebuilt for MSVSphere 9.3 + +* Fri Dec 29 2023 Michel Lind - 0.22.0-2 +- Fix license breakdown for libbpf-cargo subpackage + +* Fri Dec 29 2023 Michel Lind - 0.22.0-1 +- Update to 0.22.0 + +* Wed Aug 02 2023 Michel Alexandre Salim - 0.21.2-1 +- Update to 0.21.2 + +* Thu Jul 27 2023 Michel Alexandre Salim - 0.13.1-6 +- Always use vendored libbpf for consistency + +* Fri Jul 21 2023 Fedora Release Engineering - 0.13.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jan 30 2023 Michel Alexandre Salim - 0.13.1-4 +- Unify spec so novendor is toggled based on Fedora release version + +* Fri Jan 27 2023 Michel Alexandre Salim - 0.13.1-3 +- Remove unused patch + +* Fri Jan 20 2023 Fedora Release Engineering - 0.13.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 17 2023 Michel Alexandre Salim - 0.13.1-1 +- Update to 0.13.1 + +* Sun Jul 24 2022 Fabio Valentini - 0.10.0-3 +- Bump scroll and scroll_derive from 0.10 to 0.11, goblin from 0.2 to 0.5 + +* Sat Jul 23 2022 Fedora Release Engineering - 0.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Feb 17 2022 Michel Alexandre Salim - 0.10.0-1 +- Update to 0.10.0 (resolves: rhbz#2028951) + +* Tue Feb 15 2022 Zbigniew Jędrzejewski-Szmek - 0.9.3-3 +- Rebuild with package notes + +* Fri Jan 21 2022 Fedora Release Engineering - 0.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Nov 11 2021 Davide Cavalca - 0.9.3-1 +- Update to 0.9.3; Fixes: RHBZ#2022162 + +* Mon Oct 25 2021 Davide Cavalca - 0.9.2-2 +- Downgrade libbpf-sys to 0.4.0-2 on Fedora 35 and earlier + +* Thu Oct 14 2021 Davide Cavalca - 0.9.2-1 +- Update to 0.9.2; Fixes: RHBZ#1989691 + +* Fri Jul 30 2021 Davide Cavalca - 0.8.1-1 +- Update to 0.8.1; Fixes: RHBZ#1983186 + +* Thu Jul 29 2021 Davide Cavalca - 0.7.2-4 +- Workaround https://pagure.io/fedora-rust/rust2rpm/issue/138 + +* Fri Jul 23 2021 Fedora Release Engineering - 0.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Jun 26 2021 Davide Cavalca - 0.7.2-1 +- Update to 0.7.2 + +* Wed Jun 16 2021 Davide Cavalca - 0.7.1-2 +- Add clang and rustfmt to Requires as they're runtime dependencies + +* Thu Jun 03 2021 Davide Cavalca - 0.7.1-1 +- Update to 0.7.1 +- Build for all architectures +- Enable tests by default and gate out the ones that don't work +- Backport PR#112 to bump libbpf-sys to 0.4.0-1 + +* Wed Jun 02 2021 Davide Cavalca - 0.7.0-1 +- Initial package +