# 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: 6%{?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 %license LICENSE-APACHE LICENSE-MIT %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 # Install library files manually since this is a library crate mkdir -p %{buildroot}%{crate_instdir} # Create a standalone Cargo.toml without workspace inheritance cat > %{buildroot}%{crate_instdir}/Cargo.toml << 'EOF' [package] name = "iceoryx2" description = "iceoryx2: Lock-Free Zero-Copy Interprocess Communication" categories = ["network-programming"] edition = "2021" homepage = "https://iceoryx.io" keywords = ["zero-copy", "communication", "ipc", "publish-subscribe", "request-response"] license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/eclipse-iceoryx/iceoryx2" rust-version = "1.81" version = "0.7.0" [features] # Enables https://crates.io/crates/log as default logger logger_log = ["iceoryx2-bb-log/logger_log"] # Enables https://crates.io/crates/tracing as default logger logger_tracing = ["iceoryx2-bb-log/logger_tracing"] # The permissions of all resources will be set to read, write, execute for everyone. # This shall not be used in production and is meant to be enabled in a docker environment # with inconsistent user configuration. dev_permissions = ["iceoryx2-cal/dev_permissions"] # Use https://crates.io/crates/libc for the platform abstraction. This simplifies # cross-compilation since bindgen is not required anymore. Unfortunately, the libc crate # does not offer all the functionality iceoryx2 requires on all of the supported # platforms. Therefore, only a subset of the supported platforms will work with this # feature flag. libc_platform = ["iceoryx2-bb-posix/libc_platform"] [dependencies] iceoryx2-bb-container = "0.7.0" iceoryx2-bb-derive-macros = "0.7.0" iceoryx2-bb-system-types = "0.7.0" iceoryx2-bb-lock-free = "0.7.0" iceoryx2-bb-log = "0.7.0" iceoryx2-bb-memory = "0.7.0" iceoryx2-bb-posix = "0.7.0" iceoryx2-bb-elementary = "0.7.0" iceoryx2-bb-elementary-traits = "0.7.0" iceoryx2-cal = "0.7.0" iceoryx2-pal-concurrency-sync = "0.7.0" iceoryx2-pal-configuration = "0.7.0" serde = { version = "1.0.203", features = ["derive"] } toml = "0.8.13" tiny-fn = "0.1.6" EOF cp -a iceoryx2/src %{buildroot}%{crate_instdir}/ # Copy other potentially useful files for dir in iceoryx2/benches iceoryx2/tests; do if [ -d "$dir" ]; then cp -a "$dir" %{buildroot}%{crate_instdir}/ fi done # Generate .cargo-checksum.json for the installed crate echo '{"files":{},"package":null}' > %{buildroot}%{crate_instdir}/.cargo-checksum.json %if %{with check} %check %cargo_test %endif %changelog * Wed Oct 02 2024 Assistant - 0.7.0-6 - Add .cargo-checksum.json file for proper cargo registry integration * Tue Oct 01 2024 Assistant - 0.7.0-5 - Fix RPM provides generation by using standard cargo_install macro - Properly install workspace crates to generate correct crate() provides * 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