# Spec file for building Ankaios in offline/network-less environments # Follows Fedora Rust packaging guidelines # Generated by rust2rpm 26 %bcond_without check %global crate ankaios Name: ankaios Version: 1.0.0 Release: 2%{?dist} Summary: Workload and container orchestration for automotive High Performance Computing # The entire source code is Apache-2.0 License: Apache-2.0 URL: https://github.com/eclipse-ankaios/ankaios Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Vendored dependencies tarball for offline builds # To generate: # wget https://github.com/eclipse-ankaios/ankaios/archive/v%%{version}/%%{name}-%%{version}.tar.gz # tar -xzf %%{name}-%%{version}.tar.gz # cd %%{name}-%%{version} # cargo vendor # tar -czf %%{name}-%%{version}-vendor.tar.gz vendor Source1: %{name}-%{version}-vendor.tar.gz # Patch to support multiple config file paths (PR #710) # Backport of commit 1730739f from post-1.0.0 Patch0: 710.patch # Rust packaging dependencies BuildRequires: rust-packaging BuildRequires: cargo BuildRequires: rust # Build dependencies for protobuf compilation BuildRequires: protobuf-compiler # systemd integration BuildRequires: systemd-rpm-macros %{?systemd_requires} # Runtime dependencies Requires: podman %description Eclipse Ankaios provides workload and container orchestration for automotive High Performance Computing Platforms (HPCs). While it can be used for various fields of applications, it is developed from scratch for automotive use cases and provides a slim, yet powerful solution to manage containerized applications. It supports various container runtimes with Podman as the first one, but other container runtimes and even native applications can be supported. Eclipse Ankaios manages multiple nodes and virtual machines with a single unique API in order to start, stop, configure, and update containers and workloads. %package server Summary: Eclipse Ankaios server component Requires: %{name} = %{version}-%{release} %{?systemd_requires} %description server This package contains the Ankaios server component (ank-server), which manages the orchestration of workloads across multiple nodes. %package agent Summary: Eclipse Ankaios agent component Requires: %{name} = %{version}-%{release} %{?systemd_requires} %description agent This package contains the Ankaios agent component (ank-agent), which runs on each node and communicates with the server to manage local workloads. %prep %autosetup -n %{name}-%{version} -p1 # Extract vendored dependencies tarball tar -xzf %{SOURCE1} # Remove upstream .cargo/config.toml that forces musl target rm -f .cargo/config.toml # Setup cargo for vendored dependencies %cargo_prep -v vendor # Override any parent directory config that forces musl by explicitly setting native target # Local config takes precedence over parent directory configs # Determine the Rust target triple based on architecture case "$(uname -m)" in x86_64) RUST_TARGET="x86_64-unknown-linux-gnu" ;; aarch64) RUST_TARGET="aarch64-unknown-linux-gnu" ;; *) echo "Unsupported architecture: $(uname -m)" >&2 exit 1 ;; esac # Add target to [build] section by inserting after the [build] line sed -i '/^\[build\]/a\ target = "'${RUST_TARGET}'"' .cargo/config.toml %build # Build all binaries in the workspace %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # Install binaries (built with rpm profile and architecture-specific target) %ifarch x86_64 install -D -p -m 0755 target/x86_64-unknown-linux-gnu/rpm/ank %{buildroot}%{_bindir}/ank install -D -p -m 0755 target/x86_64-unknown-linux-gnu/rpm/ank-server %{buildroot}%{_bindir}/ank-server install -D -p -m 0755 target/x86_64-unknown-linux-gnu/rpm/ank-agent %{buildroot}%{_bindir}/ank-agent %endif %ifarch aarch64 install -D -p -m 0755 target/aarch64-unknown-linux-gnu/rpm/ank %{buildroot}%{_bindir}/ank install -D -p -m 0755 target/aarch64-unknown-linux-gnu/rpm/ank-server %{buildroot}%{_bindir}/ank-server install -D -p -m 0755 target/aarch64-unknown-linux-gnu/rpm/ank-agent %{buildroot}%{_bindir}/ank-agent %endif # Install configuration files from source install -D -p -m 0644 server/config/ank-server.conf %{buildroot}%{_sysconfdir}/ankaios/ank-server.conf install -D -p -m 0644 agent/config/ank-agent.conf %{buildroot}%{_sysconfdir}/ankaios/ank-agent.conf install -D -p -m 0644 ank/config/ank.conf %{buildroot}%{_sysconfdir}/ankaios/ank.conf # Install sample startup state install -D -p -m 0644 /dev/stdin %{buildroot}%{_sysconfdir}/ankaios/state.yaml <<'EOF' # Per default no workload is started. Adapt the manifest according to your needs. apiVersion: v1 workloads: {} EOF # Install systemd service files (these don't exist in source, created like install.sh does) install -D -p -m 0644 /dev/stdin %{buildroot}%{_unitdir}/ank-server.service <<'EOF' [Unit] Description=Ankaios Server Documentation=https://eclipse-ankaios.github.io/ankaios After=network.target [Service] Type=simple Environment="RUST_LOG=info" ExecStart=%{_bindir}/ank-server Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target EOF install -D -p -m 0644 /dev/stdin %{buildroot}%{_unitdir}/ank-agent.service <<'EOF' [Unit] Description=Ankaios Agent Documentation=https://eclipse-ankaios.github.io/ankaios After=network.target ank-server.service Wants=ank-server.service [Service] Type=simple Environment="RUST_LOG=info" ExecStart=%{_bindir}/ank-agent Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target EOF %if %{with check} %check # Run tests for the workspace %cargo_test %endif %post server %systemd_post ank-server.service %preun server %systemd_preun ank-server.service %postun server %systemd_postun_with_restart ank-server.service %post agent %systemd_post ank-agent.service %preun agent %systemd_preun ank-agent.service %postun agent %systemd_postun_with_restart ank-agent.service %files %license LICENSE %license LICENSE.dependencies %doc README.md %{_bindir}/ank %config(noreplace) %{_sysconfdir}/ankaios/ank.conf %files server %{_bindir}/ank-server %{_unitdir}/ank-server.service %dir %{_sysconfdir}/ankaios %config(noreplace) %{_sysconfdir}/ankaios/ank-server.conf %config(noreplace) %{_sysconfdir}/ankaios/state.yaml %files agent %{_bindir}/ank-agent %{_unitdir}/ank-agent.service %config(noreplace) %{_sysconfdir}/ankaios/ank-agent.conf %changelog * Tue Mar 24 2026 Pierre-Yves Chibon - 1.0.0-2 - Apply PR #710 patch (backport of commit 1730739f) - Add support for multiple CLI config file paths - CLI now checks both user config ($HOME/.config/ankaios/ank.conf) and system config (/etc/ankaios/ank.conf) * Tue Mar 24 2026 Pierre-Yves Chibon - 1.0.0-1 - Initial package for Ankaios 1.0.0