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

diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..c4ff788
--- /dev/null
@@ -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 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/rust-regex-automata.spec b/packaging/rust-regex-automata.spec
new file mode 100644 (file)
index 0000000..b5b8278
--- /dev/null
@@ -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