From d097857bdbb370694ff609749a37b7135460eff6 Mon Sep 17 00:00:00 2001 From: Woohyun Jung Date: Tue, 14 Mar 2023 10:24:09 +0900 Subject: Bump to rust-aho-corasick 0.7.20 --- packaging/extern.patch | 14 ++++++++ packaging/rust-aho-corasick.manifest | 5 +++ packaging/rust-aho-corasick.spec | 68 ++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 packaging/extern.patch create mode 100644 packaging/rust-aho-corasick.manifest create mode 100644 packaging/rust-aho-corasick.spec diff --git a/packaging/extern.patch b/packaging/extern.patch new file mode 100644 index 0000000..be8e0dd --- /dev/null +++ b/packaging/extern.patch @@ -0,0 +1,14 @@ +diff --git a/src/lib.rs b/src/lib.rs +index 4465a56..ce5bf3c 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -181,6 +181,9 @@ disabled via + + #![deny(missing_docs)] + ++extern crate std; ++extern crate memchr; ++ + // We can never be truly no_std, but we could be alloc-only some day, so + // require the std feature for now. + #[cfg(not(feature = "std"))] diff --git a/packaging/rust-aho-corasick.manifest b/packaging/rust-aho-corasick.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/rust-aho-corasick.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/rust-aho-corasick.spec b/packaging/rust-aho-corasick.spec new file mode 100644 index 0000000..fc6e778 --- /dev/null +++ b/packaging/rust-aho-corasick.spec @@ -0,0 +1,68 @@ +# Generated by rust2rpm 23 +%global _rpm_strip_disable 1 +%global debug_package %{nil} + +%global crate aho-corasick +%global real_crate_name aho_corasick +%global rustc_edition 2018 + +Name: rust-aho-corasick +Version: 0.7.20 +Release: 1 +Summary: Fast multiple substring searching + +License: Unlicense OR MIT +URL: https://crates.io/crates/aho-corasick +Source: %{crate}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: extern.patch + +# ========================================================== +# BuildRequires +# specifies build-time dependencies for the package +# ========================================================== +BuildRequires: rust +BuildRequires: rust-memchr +Requires: rust-memchr + +%description +Fast multiple substring searching. + +%prep +%setup -q +cp %{SOURCE1} . +%{__patch} -p1 < %{SOURCE2} + +# ========================================================== +# build section +# crate-type : dylib, proc-macro, cdylib, bin, etc. +# ========================================================== +%build +%{rustc_std_build} --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + --cfg='feature="std"' \ + --extern memchr=%{_rust_dylibdir}/libmemchr.so \ + ./src/lib.rs + +# ========================================================== +# install section +# ========================================================== +%install +install -d -m 0755 %{buildroot}%{_rust_dylibdir} +install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/lib%{real_crate_name}.so + +%clean + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +# ========================================================== +# files section +# ========================================================== +%files +%manifest %{name}.manifest +%license UNLICENSE +%license LICENSE-MIT +%{_rust_dylibdir}/lib%{real_crate_name}.so -- cgit v1.2.3