From 128e6c8b8fc44ae98c6a37ecd9ea7bb7aa74f020 Mon Sep 17 00:00:00 2001 From: Woohyun Jung Date: Tue, 14 Mar 2023 15:30:32 +0900 Subject: [PATCH] Bump to rust-regex-automata 0.2.0 --- packaging/extern.patch | 11 ++++ packaging/rust-regex-automata.manifest | 5 ++ packaging/rust-regex-automata.spec | 77 ++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 packaging/extern.patch create mode 100644 packaging/rust-regex-automata.manifest create mode 100644 packaging/rust-regex-automata.spec diff --git a/packaging/extern.patch b/packaging/extern.patch new file mode 100644 index 0000000..c4ff788 --- /dev/null +++ b/packaging/extern.patch @@ -0,0 +1,11 @@ +diff --git a/src/lib.rs b/src/lib.rs +index d9d7ada..c7c22b7 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -45,3 +45,6 @@ pub mod hybrid; + pub mod nfa; + #[doc(hidden)] + pub mod util; ++ ++extern crate regex_syntax; ++extern crate memchr; diff --git a/packaging/rust-regex-automata.manifest b/packaging/rust-regex-automata.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/rust-regex-automata.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/rust-regex-automata.spec b/packaging/rust-regex-automata.spec new file mode 100644 index 0000000..b5b8278 --- /dev/null +++ b/packaging/rust-regex-automata.spec @@ -0,0 +1,77 @@ +# Generated by rust2rpm 23 +%global _rpm_strip_disable 1 +%global debug_package %{nil} + +%global crate regex-automata +%global real_crate_name regex_automata +%global rustc_edition 2018 + +Name: rust-regex-automata +Version: 0.2.0 +Release: 1 +Summary: Automata construction and matching using regular expressions + +# Upstream license specification: Unlicense/MIT +License: Unlicense OR MIT +URL: https://crates.io/crates/regex-automata +Source: %{crate}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: extern.patch + +# ========================================================== +# BuildRequires +# specifies build-time dependencies for the package +# ========================================================== +BuildRequires: rust +#BuildRequires: rust-fst #for "transducer" feature +BuildRequires: rust-log +BuildRequires: rust-memchr +BuildRequires: rust-regex-syntax +Requires: rust-log +Requires: rust-memchr +Requires: rust-regex-syntax + + +%description +Automata construction and matching using regular expressions. + +%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"' \ + --cfg='feature="alloc"' \ + --cfg='feature="syntax"' \ + --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 -- 2.34.1