Bump to rust-const-random-macro 0.1.15 accepted/tizen_9.0_unified accepted/tizen_rust accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.233454 accepted/tizen/rust/20231016.021027 accepted/tizen/unified/20240328.121810 accepted/tizen/unified/dev/20240620.001234 accepted/tizen/unified/x/20240328.130555 tizen_9.0_m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 9 Mar 2023 22:47:46 +0000 (07:47 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 9 Mar 2023 22:47:46 +0000 (07:47 +0900)
packaging/extern.patch [new file with mode: 0644]
packaging/rust-const-random-macro.manifest [new file with mode: 0644]
packaging/rust-const-random-macro.spec [new file with mode: 0644]

diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..9cb6ab5
--- /dev/null
@@ -0,0 +1,16 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index f711a13..882f591 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -1,6 +1,11 @@
+ #[allow(unused_extern_crates)]
+ extern crate proc_macro;
++extern crate getrandom;
++extern crate once_cell;
++extern crate proc_macro_hack;
++extern crate tiny_keccak;
++
+ use proc_macro::*;
+ use proc_macro_hack::proc_macro_hack;
+ use std::iter::once;
diff --git a/packaging/rust-const-random-macro.manifest b/packaging/rust-const-random-macro.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-const-random-macro.spec b/packaging/rust-const-random-macro.spec
new file mode 100644 (file)
index 0000000..2099440
--- /dev/null
@@ -0,0 +1,73 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate const-random-macro
+%global real_crate_name const_random_macro
+%global rustc_edition 2018
+
+Name:           rust-const-random-macro
+Version:        0.1.15
+Release:        1
+Summary:        Provides the procedural macro used by const-random
+
+License:        MIT OR Apache-2.0
+URL:            https://crates.io/crates/const-random-macro
+Source:         %{crate}-%{version}.tar.gz
+Source1:        %{name}.manifest
+Source2:        extern.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires:  rust
+BuildRequires:  rust-getrandom
+BuildRequires:  rust-once_cell
+BuildRequires:  rust-proc-macro-hack
+BuildRequires:  rust-tiny-keccak
+
+Requires:       rust-getrandom
+Requires:       rust-once_cell
+Requires:       rust-proc-macro-hack
+Requires:       rust-tiny-keccak
+
+%description
+Provides the procedural macro used by const-random.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+%{__patch} -p1 < %{SOURCE2}
+
+# ==========================================================
+# build section
+# crate-type : dylib, proc-macro, cdylib, bin, etc.
+# ==========================================================
+%build
+%{rustc_std_build} --crate-type=proc-macro \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        ./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