# 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 %global crate_instdir %{_datadir}/cargo/registry/%{crate}-%{version} Name: rust-iceoryx2 Version: 0.7.0 Release: 4%{?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 %{crate_instdir}/ %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 # Remove workspace members that have external dependencies not available in repos sed -i '/iceoryx2-cli/d' Cargo.toml sed -i '/iceoryx2-tunnels\/zenoh/d' Cargo.toml sed -i '/iceoryx2-tunnels\/end-to-end-testing/d' Cargo.toml sed -i '/iceoryx2-ffi\/c/d' Cargo.toml sed -i '/iceoryx2-ffi\/python/d' Cargo.toml sed -i '/iceoryx2-ffi\/ffi-macros/d' Cargo.toml sed -i '/iceoryx2-userland\/record-and-replay/d' Cargo.toml sed -i '/examples/d' Cargo.toml sed -i '/benchmarks\//d' Cargo.toml # Comment out entire windows-sys workspace dependency block to avoid resolution on non-Windows sed -i '/^windows-sys = /,/^]/s/^/#/' Cargo.toml # Also comment out workspace references to windows-sys in individual crates find . -name "Cargo.toml" -exec sed -i 's/^windows-sys = { workspace = true }/#&/' {} \; %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 %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build -f libc_platform %install # Use cargo install for the main iceoryx2 crate specifically pushd iceoryx2 %cargo_install popd # Manually install the workspace source files for other crates to depend on mkdir -p %{buildroot}%{crate_instdir} cp -r . %{buildroot}%{crate_instdir}/ rm -rf %{buildroot}%{crate_instdir}/target %if %{with check} %check %cargo_test %endif %changelog * Mon Sep 30 2024 Assistant - 0.7.0-4 - Use standard %%cargo_install macro instead of manual installation - Fix RPM crate provides generation for proper dependency resolution * Mon Sep 30 2024 Assistant - 0.7.0-3 - Fix feature package file paths using undefined %%{crate_instdir} macro * 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