diff options
-rw-r--r-- | packaging/extern.patch | 13 | ||||
-rw-r--r-- | packaging/rust-bytecheck_derive.manifest | 5 | ||||
-rw-r--r-- | packaging/rust-bytecheck_derive.spec | 75 |
3 files changed, 93 insertions, 0 deletions
diff --git a/packaging/extern.patch b/packaging/extern.patch new file mode 100644 index 0000000..052a6d0 --- /dev/null +++ b/packaging/extern.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib.rs b/src/lib.rs +index ef61982..93fcd09 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -9,6 +9,8 @@ + clippy::all
+ )]
+
++extern crate proc_macro;
++
+ use proc_macro2::{Group, Span, TokenStream, TokenTree};
+ use quote::{quote, quote_spanned};
+ use syn::{
diff --git a/packaging/rust-bytecheck_derive.manifest b/packaging/rust-bytecheck_derive.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/rust-bytecheck_derive.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/rust-bytecheck_derive.spec b/packaging/rust-bytecheck_derive.spec new file mode 100644 index 0000000..9be6a6e --- /dev/null +++ b/packaging/rust-bytecheck_derive.spec @@ -0,0 +1,75 @@ +# Generated by rust2rpm 23 +%global _rpm_strip_disable 1 +%global debug_package %{nil} + +%global crate bytecheck_derive +%global real_crate_name bytecheck_derive +%global rustc_edition 2021 + +Name: rust-bytecheck_derive +Version: 0.7.0 +Release: 1 +Summary: Derive macro for bytecheck + +License: MIT +URL: https://crates.io/crates/bytecheck_derive +Source: %{crate}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: extern.patch + +# ========================================================== +# BuildRequires +# specifies build-time dependencies for the package +# ========================================================== +BuildRequires: rust +BuildRequires: rust-proc-macro2 +BuildRequires: rust-quote +BuildRequires: rust-syn + + +Requires: rust-proc-macro2 +Requires: rust-quote +Requires: rust-syn + +%description +Derive macro for bytecheck. + +%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}} \ + %rust_dylib_extern proc_macro2 \ + %rust_dylib_extern quote \ + %rust_dylib_extern syn \ + --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 +%{_rust_dylibdir}/lib%{real_crate_name}.so |