%global crate_name kitim # kitdraw is embedded as a local path dependency (not a separate package). # This is the same source tree — just a sub-crate. %global kitdraw_crate kitdraw Name: kitim Version: 0.3.0 Release: 1%{?dist} Summary: Terminal media viewer — images (browse/draw), video, and audio via Kitty graphics protocol License: MIT URL: https://github.com/wensheng/kitim Source0: kitim-%{version}.tar.gz # For local mock builds without a git tag, generate the tarball manually: # Rust edition 2024 requires rustc ≥ 1.85. Fedora 43 ships rustc 1.86+. BuildRequires: rust-packaging BuildRequires: cargo BuildRequires: pkgconfig # FFmpeg FFI — libavformat, libavcodec, libavutil, libswscale, libswresample # On Fedora these come from rpmfusion-free; enable that repo in your COPR config. BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(libswscale) BuildRequires: pkgconfig(libswresample) # cpal's ALSA backend BuildRequires: pkgconfig(alsa) # The embedded NotoSans font is a bundled dependency (SIL Open Font License) # https://github.com/googlefonts/noto-fonts Provides: bundled(noto-sans-font) = 2.013 Requires: ffmpeg-libs%{?_isa} Requires: alsa-lib%{?_isa} %description kitim turns your terminal into a fast, focused media viewer without leaving the command line. Features: - Image TUI with Browse (zoom / pan / rotate) and Draw (annotate) modes, powered by the kitdraw crate and Kitty graphics protocol. - Video playback with synced audio via FFmpeg decode + CPAL output. - Audio-only playback for MP3, M4A, AAC, WAV, FLAC, OGG, Opus, and more. - Client-side zoom cache for smooth panning (no re-encode per frame). - 1:1 sticky-pan tracking — the image feature stays under the cursor at any zoom level. - GIF loop, resume on EOF, keyboard seek in video player. %prep %autosetup -n %{crate_name} # kitdraw is embedded as a sub-crate; no separate tarball needed. # Remove its bundled .git directory if any stray copy exists. rm -rf kitdraw/.git %build # The build.rs uses pkg-config to locate FFmpeg libraries — standard # on Fedora when the -devel packages are installed. %cargo_build %install # cargo build already placed the binary in target/rpm/; we just copy it. install -Dpm 0755 target/rpm/kitim %{buildroot}%{_bindir}/kitim %files %license LICENSE %doc README.md docs/browse-mode.md %{_bindir}/kitim # kitdraw is a path dependency of kitim; its standalone binary is not # built from the root package. To build kitdraw separately: # cargo install --path kitdraw %changelog * Wed Jun 17 2026 CaoTureky - %{version}-%{release} - Initial COPR build for Fedora 43+ - Bundle kitdraw as path dependency (v0.2.1) - FFmpeg 7.x FFI with pkg-config detection - cpal ALSA audio backend - Browse mode: zoom cache, 1:1 sticky-pan formula, proportional 8192px cap - Draw mode: freehand, rect, ellipse, arrow, text, highlighter, redaction - Video player: pause-on-EOF with seek/quit commands