%define _debugsource_template %{nil} %define debug_package %{nil} %bcond_with vendored Name: fresh-editor Version: 0.3.0 Release: 2%{?dist} Summary: Modern terminal text editor and IDE License: GPL-2.0-only URL: https://github.com/sinelaw/fresh Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz %if %{with vendored} Source1: %{name}-%{version}-vendor.tar.zst %endif BuildRequires: cargo >= 1.92 BuildRequires: rust >= 1.92 BuildRequires: gcc BuildRequires: make BuildRequires: cmake BuildRequires: perl BuildRequires: pkgconf-pkg-config BuildRequires: desktop-file-utils Requires: hicolor-icon-theme Requires: /bin/sh Recommends: git Recommends: ripgrep %global _description %{expand: Fresh is a modern terminal text editor and IDE. It provides familiar GUI-style keybindings, mouse support, command palette, file explorer, LSP support, multi-cursor editing, themes, and TypeScript plugins while remaining a fast terminal application.} %description %{_description} %prep %autosetup -n fresh-%{version} rm -f rust-toolchain.toml %if %{with vendored} tar -xaf %{SOURCE1} # Source1 contains both vendor/ and the exact cargo-vendor config. # This is required because Fresh has a git dependency (ratatui-wgpu); # a generic crates.io-only vendor config makes cargo try GitHub offline. test -f .cargo/config.toml %endif %build export CARGO_HOME=$PWD/.cargo-home export RUSTFLAGS="%{?build_rustflags}" %if %{with vendored} export CARGO_NET_OFFLINE=true cargo build --release --frozen --offline -p fresh-editor --bin fresh %else cargo build --release -p fresh-editor --bin fresh %endif %install install -Dpm 0755 target/release/fresh \ %{buildroot}%{_datadir}/fresh-editor/fresh install -Dpm 0755 crates/fresh-editor/scripts/fresh-wrapper.sh \ %{buildroot}%{_bindir}/fresh install -Dpm 0644 crates/fresh-editor/resources/fresh.desktop \ %{buildroot}%{_datadir}/applications/fresh.desktop mkdir -p %{buildroot}%{_datadir}/fresh-editor/plugins cp -a crates/fresh-editor/plugins/. \ %{buildroot}%{_datadir}/fresh-editor/plugins/ mkdir -p %{buildroot}%{_datadir}/fresh-editor/themes cp -a crates/fresh-editor/themes/. \ %{buildroot}%{_datadir}/fresh-editor/themes/ mkdir -p %{buildroot}%{_datadir}/icons/hicolor cp -a docs/icons/linux/hicolor/. \ %{buildroot}%{_datadir}/icons/hicolor/ %check desktop-file-validate %{buildroot}%{_datadir}/applications/fresh.desktop %{buildroot}%{_datadir}/fresh-editor/fresh --version %files %license LICENSE %doc README.md CHANGELOG.md %{_bindir}/fresh %dir %{_datadir}/fresh-editor %{_datadir}/fresh-editor/fresh %{_datadir}/fresh-editor/plugins %{_datadir}/fresh-editor/themes %{_datadir}/applications/fresh.desktop %{_datadir}/icons/hicolor/*/apps/fresh.png %changelog * Sun Apr 26 2026 sachesi - 0.3.0-2 - Preserve cargo-vendor generated .cargo/config.toml for git dependencies * Sun Apr 26 2026 sachesi - 0.3.0-1 - Initial RPM package for Fresh 0.3.0