Bump to rust-radium 0.7.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Mar 2023 03:21:23 +0000 (12:21 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Mar 2023 03:21:23 +0000 (12:21 +0900)
packaging/extern.patch [new file with mode: 0644]
packaging/rust-radium.manifest [new file with mode: 0644]
packaging/rust-radium.spec [new file with mode: 0644]

diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..b56a648
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 00e9588..e5c4fc0 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -28,7 +28,6 @@
+ //! [`AtomicUsize`]: core::sync::atomic::AtomicUsize
+ //! [`Cell<T>`]: core::cell::Cell
+-#![no_std]
+ #![deny(unconditional_recursion)]
+ #[macro_use]
diff --git a/packaging/rust-radium.manifest b/packaging/rust-radium.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-radium.spec b/packaging/rust-radium.spec
new file mode 100644 (file)
index 0000000..c40adb2
--- /dev/null
@@ -0,0 +1,77 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate radium
+%global real_crate_name radium
+%global rustc_edition 2021
+
+Name:           rust-radium
+Version:        0.7.0
+Release:        1
+Summary:        Portable interfaces for maybe-atomic types
+
+License:        MIT
+URL:            https://crates.io/crates/radium
+Source:         %{crate}-%{version}.tar.gz
+Source1:        %{name}.manifest
+Source2:        extern.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires:  rust
+
+# ==========================================================
+# dev-dependencies
+# ==========================================================
+# BuildRequires:  rust-static_assertions 
+
+
+%description
+Portable interfaces for maybe-atomic types.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+%{__patch} -p1 < %{SOURCE2}
+
+# ==========================================================
+# build section
+# crate-type : dylib, proc-macro, cdylib, bin, etc.
+# ==========================================================
+%build
+%ifarch %{ix86} armv7l armv7hl
+export RUSTC_TARGET_HAS_ATOMIC=32
+%endif
+%ifarch x86_64 aarch64
+export RUSTC_TARGET_HAS_ATOMIC=64
+%endif
+%{rustc_std_build} --crate-type=dylib \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        --cfg='feature="atomic"' \
+        --cfg="target_has_atomic=\"$RUSTC_TARGET_HAS_ATOMIC\"" \
+        ./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.txt
+%{_rust_dylibdir}/lib%{real_crate_name}.so