Bump to rust-include_dir_macros 0.7.3
authorRoy7Kim <myoungwoon.kim@samsung.com>
Fri, 19 May 2023 08:07:07 +0000 (17:07 +0900)
committerRoy7Kim <myoungwoon.kim@samsung.com>
Fri, 19 May 2023 08:07:07 +0000 (17:07 +0900)
LICENSE [new file with mode: 0644]
packaging/extern.patch [new file with mode: 0644]
packaging/rust-include_dir_macros.manifest [new file with mode: 0644]
packaging/rust-include_dir_macros.spec [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..39e0ed6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/packaging/extern.patch b/packaging/extern.patch
new file mode 100644 (file)
index 0000000..e6f0e5a
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 51e5b4c..6dd3720 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -3,6 +3,8 @@
+ //! You probably don't want to use this crate directly.
+ #![cfg_attr(feature = "nightly", feature(track_path, proc_macro_tracked_env))]
++extern crate proc_macro;
++
+ use proc_macro::{TokenStream, TokenTree};
+ use proc_macro2::Literal;
+ use quote::quote;
diff --git a/packaging/rust-include_dir_macros.manifest b/packaging/rust-include_dir_macros.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-include_dir_macros.spec b/packaging/rust-include_dir_macros.spec
new file mode 100644 (file)
index 0000000..bfde0df
--- /dev/null
@@ -0,0 +1,69 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate include_dir_macros
+%global real_crate_name include_dir_macros
+%global rustc_edition 2021
+
+Name:           rust-include_dir_macros
+Version:        0.7.3
+Release:        1
+Summary:        Procedural macro used by include_dir
+
+License:        MIT
+URL:            https://crates.io/crates/include_dir_macros
+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
+
+
+
+%description
+Procedural macro used by include_dir.
+
+%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 quote \
+        %rust_dylib_extern proc_macro2 \
+        ./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