Bump to rust-regex 1.7.1
authorWoohyun Jung <wh0705.jung@samsung.com>
Tue, 14 Mar 2023 05:04:23 +0000 (14:04 +0900)
committerWoohyun Jung <wh0705.jung@samsung.com>
Tue, 14 Mar 2023 05:04:23 +0000 (14:04 +0900)
packaging/extern.patch [new file with mode: 0644]
packaging/rust-regex.manifest [new file with mode: 0644]
packaging/rust-regex.spec [new file with mode: 0644]

diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..3be94be
--- /dev/null
@@ -0,0 +1,10 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 6b95739..bc7541c 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -767,3 +767,5 @@ pub mod internal {
+     pub use crate::literal::LiteralSearcher;
+     pub use crate::prog::{EmptyLook, Inst, InstRanges, Program};
+ }
++
++extern crate regex_syntax;
diff --git a/packaging/rust-regex.manifest b/packaging/rust-regex.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/rust-regex.spec b/packaging/rust-regex.spec
new file mode 100644 (file)
index 0000000..a89e6ee
--- /dev/null
@@ -0,0 +1,80 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate regex
+%global real_crate_name regex
+%global rustc_edition 2018
+
+Name:           rust-regex
+Version:        1.7.1
+Release:        1
+Summary:        Implementation of regular expressions for Rust
+
+License:        MIT OR Apache-2.0
+URL:            https://crates.io/crates/regex
+Source:         %{crate}-%{version}.tar.gz
+Source1:        %{name}.manifest
+Source2:        extern.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires:  rust
+BuildRequires:  rust-aho-corasick
+BuildRequires:  rust-memchr
+BuildRequires:  rust-regex-syntax
+
+# ==========================================================
+# dev-dependencies
+# ==========================================================
+# BuildRequires:  rust-lazy_static 
+# BuildRequires:  rust-quickcheck 
+# BuildRequires:  rust-rand 
+
+
+%description
+Implementation of regular expressions for Rust. This implementation uses finite
+automata and guarantees linear time matching on all inputs.
+
+%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="perf"' \
+        --cfg='feature="unicode"' \
+        --cfg='feature="regex-syntax/default"' \
+        ./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 LICENSE-APACHE
+%license LICENSE-MIT
+%{_rust_dylibdir}/lib%{real_crate_name}.so