Bump to rust-crossbeam-channel 0.5.7
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 8 Mar 2023 06:56:44 +0000 (15:56 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 8 Mar 2023 06:56:44 +0000 (15:56 +0900)
packaging/extern.patch [new file with mode: 0644]
packaging/rust-crossbeam-channel.manifest [new file with mode: 0644]
packaging/rust-crossbeam-channel.spec [new file with mode: 0644]

diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..f7ab68d
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index cc1ef11..49c18da 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -336,6 +336,8 @@
+ )]
+ #![cfg_attr(not(feature = "std"), no_std)]
++extern crate crossbeam_utils;
++
+ use cfg_if::cfg_if;
+ cfg_if! {
diff --git a/packaging/rust-crossbeam-channel.manifest b/packaging/rust-crossbeam-channel.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-crossbeam-channel.spec b/packaging/rust-crossbeam-channel.spec
new file mode 100644 (file)
index 0000000..9de2fbf
--- /dev/null
@@ -0,0 +1,76 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate crossbeam-channel
+%global real_crate_name crossbeam_channel
+%global rustc_edition 2018
+
+Name:           rust-crossbeam-channel
+Version:        0.5.7
+Release:        1
+Summary:        Multi-producer multi-consumer channels for message passing
+
+License:        MIT OR Apache-2.0
+URL:            https://crates.io/crates/crossbeam-channel
+Source:         %{crate}-%{version}.tar.gz
+Source1:        %{name}.manifest
+Source2:        extern.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires:  rust
+BuildRequires:  rust-cfg-if
+BuildRequires:  rust-crossbeam-utils
+
+# ==========================================================
+# dev-dependencies
+# ==========================================================
+# BuildRequires:  rust-num_cpus 
+# BuildRequires:  rust-rand 
+# BuildRequires:  rust-signal-hook 
+
+
+%description
+Multi-producer multi-consumer channels for message passing.
+
+%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}} \
+        --extern cfg_if=%{_rust_dylibdir}/libcfg_if.so \
+        --cfg='feature="std"' \
+        ./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