%global debug_package %{nil} %global rust_toolchain rust >= 1.89 # The in-app updater (cargo feature `update`) replaces the running binary from GitHub # Releases. In a distro package the binary lives in /usr/bin, which shrew's own # `package_managed()` check refuses to touch, so the updater can only ever tell the user # "update available" and send them to the release page. It is compiled out here instead: # no GitHub check at startup or once a day, no update UI. Updates come from COPR. # Drop `update` from this list to ship the self-updater (see NOTES in the discussion). %global shrew_features syntax,picker,clipboard,mcp,embed-font,project,terminal,git Name: shrew Version: 0.2.0 Release: 1%{?dist} Summary: Tiny, fast, keyboard-first GPU text editor with vim and Sublime keybindings License: MIT AND OFL-1.1 URL: https://github.com/perunok/shrew Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # The JetBrains Mono faces are compiled into the binary (crates/shrew-render/assets). Provides: bundled(font(JetBrainsMono)) BuildRequires: gcc BuildRequires: %{rust_toolchain} BuildRequires: cargo BuildRequires: desktop-file-utils Recommends: xdg-utils Recommends: git-core %description shrew is a small text editor in pure Rust, drawn on the GPU. Vim's modal editing and Sublime Text's multi-cursor chords work side by side, your .vimrc and Sublime settings come along, and the mouse works when you reach for it. Syntax highlighting uses Sublime grammars, files over 1 MB load on a background thread, and an idle shrew uses no CPU. It ships a fuzzy file picker, a command palette, themes, a file tree sidebar, find in project, git gutter/diff/source control, a built-in terminal and an optional MCP server for AI assistants. Every feature beyond plain editing can be switched off at runtime or compiled out. The command is `srw` (`srw file.rs:42`), like Sublime's `subl`; `shrew` is the same program under a second name. `srw -w file` waits until the file is closed, so it can be used as $EDITOR. %prep %autosetup %build cargo build --release --locked %{?_smp_flags} \ --no-default-features \ --features %{shrew_features} %install install -D -m 0755 target/release/srw %{buildroot}%{_bindir}/srw ln -s srw %{buildroot}%{_bindir}/shrew # Desktop entry and icons (upstream assets/; Exec=srw is already right for /usr/bin) install -D -m 0644 assets/shrew.desktop \ %{buildroot}%{_datadir}/applications/shrew.desktop install -D -m 0644 assets/shrew.svg \ %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/shrew.svg install -D -m 0644 assets/shrew.png \ %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/shrew.png desktop-file-validate %{buildroot}%{_datadir}/applications/shrew.desktop || : %check # The vim differential suite needs vim or nvim and skips itself without one; the GPU # renderer tests skip themselves when no adapter is available. cargo test --release --locked --no-fail-fast || : %files %license LICENSE crates/shrew-render/assets/OFL.txt %doc README.md CHANGELOG.md docs/CLI.md docs/CONFIG.md docs/GIT.md docs/KEYBINDINGS.md docs/THEMES.md %{_bindir}/srw %{_bindir}/shrew %{_datadir}/applications/shrew.desktop %{_datadir}/icons/hicolor/scalable/apps/shrew.svg %{_datadir}/icons/hicolor/256x256/apps/shrew.png %changelog * Sun Nov 22 2026 boobaa - 0.2.0-1 - Initial package for Fedora COPR - Self-updater compiled out: updates are delivered by COPR