summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2023-03-10 08:18:00 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2023-03-10 08:18:00 +0900
commit640b934668925f03ab005d685c9f92849da2033b (patch)
tree886d2ccea54fc79a6d3bd9371798753c1a85ff9d
parent16bf4f0d57ced86e37ca1de15d6f88e6cc43ee2e (diff)
downloadrust-const-random-640b934668925f03ab005d685c9f92849da2033b.tar.gz
rust-const-random-640b934668925f03ab005d685c9f92849da2033b.tar.bz2
rust-const-random-640b934668925f03ab005d685c9f92849da2033b.zip
Bump to rust-const-random 0.1.15
-rw-r--r--packaging/extern.patch12
-rw-r--r--packaging/rust-const-random.manifest5
-rw-r--r--packaging/rust-const-random.spec70
3 files changed, 87 insertions, 0 deletions
diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644
index 0000000..1f18070
--- /dev/null
+++ b/packaging/extern.patch
@@ -0,0 +1,12 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 00ce882..988a883 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -1,4 +1,6 @@
+-#![no_std]
++extern crate proc_macro_hack;
++extern crate const_random_macro;
++
+ use proc_macro_hack::proc_macro_hack;
+
+ /// # Random constants
diff --git a/packaging/rust-const-random.manifest b/packaging/rust-const-random.manifest
new file mode 100644
index 0000000..017d22d
--- /dev/null
+++ b/packaging/rust-const-random.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/rust-const-random.spec b/packaging/rust-const-random.spec
new file mode 100644
index 0000000..7fec401
--- /dev/null
+++ b/packaging/rust-const-random.spec
@@ -0,0 +1,70 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate const-random
+%global real_crate_name const_random
+%global rustc_edition 2018
+
+Name: rust-const-random
+Version: 0.1.15
+Release: 1
+Summary: Provides compile time random number generation
+
+License: MIT OR Apache-2.0
+URL: https://crates.io/crates/const-random
+Source: %{crate}-%{version}.tar.gz
+Source1: %{name}.manifest
+Source2: extern.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires: rust
+BuildRequires: rust-const-random-macro
+BuildRequires: rust-proc-macro-hack
+
+Requires: rust-const-random-macro
+Requires: rust-proc-macro-hack
+
+%description
+Provides compile time random number generation.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+%{__patch} -p1 < %{SOURCE2}
+
+# ==========================================================
+# build section
+# crate-type : dylib, proc-macro, cdylib, bin, etc.
+# ==========================================================
+%build
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_rust_dylibdir}
+%{rustc_std_build} --crate-type=dylib \
+ --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