# Generated by rust2rpm 27 %bcond check 0 %global debug_package %{nil} %define __brp_mangle_shebangs %{nil} %define __brp_strip %{nil} %define __brp_strip_comment_note %{nil} %define __brp_strip_static_archive %{nil} %define __brp_strip_lto %{nil} %global crate iceoryx2 Name: rust-iceoryx2 Version: 0.7.0 Release: 2%{?dist} Summary: Iceoryx2: Lock-Free Zero-Copy Interprocess Communication License: MIT OR Apache-2.0 URL: https://crates.io/crates/iceoryx2 Source: iceoryx2-%{version}-vendor.tar.gz BuildRequires: cargo-rpm-macros >= 24 BuildRequires: clang-devel BuildRequires: python3-devel %global _description %{expand: Iceoryx2: Lock-Free Zero-Copy Interprocess Communication.} %description %{_description} %package devel Summary: %{summary} %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel # FIXME: no license files detected %doc README.md %{_datadir}/cargo/registry/ %package -n %{name}+default-devel Summary: %{summary} %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+dev_permissions-devel Summary: %{summary} %description -n %{name}+dev_permissions-devel %{_description} This package contains library source intended for building other packages which use the "dev_permissions" feature of the "%{crate}" crate. %files -n %{name}+dev_permissions-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+libc_platform-devel Summary: %{summary} %description -n %{name}+libc_platform-devel %{_description} This package contains library source intended for building other packages which use the "libc_platform" feature of the "%{crate}" crate. %files -n %{name}+libc_platform-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+logger_log-devel Summary: %{summary} %description -n %{name}+logger_log-devel %{_description} This package contains library source intended for building other packages which use the "logger_log" feature of the "%{crate}" crate. %files -n %{name}+logger_log-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+logger_tracing-devel Summary: %{summary} %description -n %{name}+logger_tracing-devel %{_description} This package contains library source intended for building other packages which use the "logger_tracing" feature of the "%{crate}" crate. %files -n %{name}+logger_tracing-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 # Fix problematic shebang that causes dependency on /usr/local/bin/python sed -i 's|#!/usr/local/bin/python|#!/usr/bin/python3|' vendor/pyo3/emscripten/runner.py # Calculate and update the checksum dynamically for the modified file NEW_CHECKSUM=$(sha256sum vendor/pyo3/emscripten/runner.py | cut -d' ' -f1) sed -i "s/\"emscripten\/runner\.py\":\"[^\"]*\"/\"emscripten\/runner.py\":\"$NEW_CHECKSUM\"/" vendor/pyo3/.cargo-checksum.json %cargo_prep mkdir -p .cargo cat > .cargo/config.toml << 'EOF' [source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "vendor" EOF cat >> Cargo.toml << 'EOF' [profile.rpm] inherits = "release" EOF # No generate_buildrequires - all dependencies vendored %build %cargo_build -f libc_platform %install mkdir -p %{buildroot}%{_datadir}/cargo/registry/%{crate}-%{version} cp -r . %{buildroot}%{_datadir}/cargo/registry/%{crate}-%{version}/ # Remove target directory with compiled binaries to avoid noarch conflicts rm -rf %{buildroot}%{_datadir}/cargo/registry/%{crate}-%{version}/target %if %{with check} %check %cargo_test %endif %changelog * Mon Sep 30 2024 Assistant - 0.7.0-2 - Fix problematic shebang in vendored pyo3 causing /usr/local/bin/python dependency - Use dynamic checksum calculation to handle vendored source modifications * Thu Sep 26 2024 Pierre-Yves Chibon - 0.7.0-1 - Initial package