--- /dev/null
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate proc-macro2
+%global real_crate_name proc_macro2
+
+Name: rust-proc-macro2
+Version: 1.0.51
+Release: 1%{?dist}
+Summary: Substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case
+
+License: MIT OR Apache-2.0
+URL: https://crates.io/crates/proc-macro2
+Source: %{crate}-%{version}.tar.gz
+Source1: %{name}.manifest
+Source2: extern_core-unicode_ident.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires: rust
+BuildRequires: rust-unicode-ident
+
+
+%description
+Substitute implementation of the compiler's `proc_macro` API to decouple token-
+based libraries from the procedural macro use case.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+%{__patch} -p1 < %{SOURCE2}
+
+# ==========================================================
+# build section
+# ==========================================================
+%build
+rust_std=$(find %{_libdir} -maxdepth 1 -name "libstd-*\.so")
+rustc -C prefer-dynamic \
+ --crate-type=dylib \
+ --crate-name="%{real_crate_name}" \
+ --extern std=${rust_std} \
+ -L%{_libdir} -lunicode_ident \
+ ./src/lib.rs
+
+# ==========================================================
+# install section
+# ==========================================================
+%install
+install -d -m 0755 %{buildroot}%{_libdir}
+install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_libdir}/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
+%{_libdir}/lib%{real_crate_name}.so