%global debug_package %{nil} Name: fp-no-dash Version: 0.2.4 Release: %autorelease Summary: A lightweight Rust dashboard for self-hosted services License: MIT URL: https://gitlab.com/fpsys/fp-no-dash Source0: fp-no-dash-0.2.4.tar.gz Source1: fp-no-dash.service # No BuildRequires on rust or cargo: the Fedora packages are stable, and # this project needs a nightly toolchain (immediate-abort panic strategy # plus a build-std config), so the toolchain is installed from upstream in # the build script below. rpmautospec supplies the autorelease macro, # curl and ca-certificates fetch the toolchain and the crates.io index, # gcc is the linker. BuildRequires: gcc BuildRequires: ca-certificates BuildRequires: systemd-rpm-macros BuildRequires: curl BuildRequires: rpmautospec %description fp-no-dash is a lightweight Rust dashboard for self-hosted services. Everything is prepared at build time. %prep %setup -q -n fp-no-dash-0.2.4 %build # Same toolchain the build-binaries job uses: "rustup toolchain install" # with no argument installs exactly what rust-toolchain.toml pins # (nightly plus rust-src, which build-std needs), so the RPM and the CI # artifact cannot drift apart. This runs inside the buildroot, so rustup # and the toolchain land in the build user's home and never in the # package. The HOME below must survive the heredoc unexpanded, hence the # backslashes; everything else here is literal. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none . "$HOME/.cargo/env" rustup toolchain install cargo build --release --locked %install mkdir -p %{buildroot}%{_bindir} install -m 755 target/release/fp-no-dash %{buildroot}%{_bindir}/fp-no-dash mkdir -p %{buildroot}%{_userunitdir} install -m 644 %{SOURCE1} %{buildroot}%{_userunitdir}/fp-no-dash.service %post %systemd_user_post fp-no-dash.service %preun %systemd_user_preun fp-no-dash.service %files %{_bindir}/fp-no-dash %{_userunitdir}/fp-no-dash.service %license LICENSE %doc README.md %changelog %autochangelog