File yazi.spec of Package yazi

#
# spec file for package yazi
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global build_rustflags %build_rustflags -C debuginfo=0
Name:           yazi
Version:        25.9.15+git20251022.157156b5
Release:        0
Summary:        Blazing fast terminal file manager written in Rust, based on async I/O
License:        MIT
URL:            https://github.com/sxyazi/%{name}
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.zst
BuildRequires:  cargo
BuildRequires:  cargo-packaging
BuildRequires:  git-core
BuildRequires:  rust
Suggests:       fd
Suggests:       fzf
Suggests:       zoxide
Suggests:       rg

%description
Yazi (means "duck") is a terminal file manager written in Rust, based on non-blocking async I/O. It aims to provide an efficient, user-friendly, and customizable file management experience.

πŸ’‘ A new article explaining its internal workings: Why is Yazi Fast? (https://yazi-rs.github.io/blog/why-is-yazi-fast)

  πŸš€ Full Asynchronous Support: All I/O operations are asynchronous, CPU tasks are spread across multiple threads, making the most of available resources.
  πŸ’ͺ Powerful Async Task Scheduling and Management: Provides real-time progress updates, task cancellation, and internal task priority assignment.
  πŸ–ΌοΈ Built-in Support for Multiple Image Protocols: Also integrated with Überzug++, covering almost all terminals.
  🌟 Built-in Code Highlighting and Image Decoding: Combined with the pre-loading mechanism, greatly accelerates image and normal file loading.
  πŸ”Œ Concurrent Plugin System: UI plugins (rewriting most of the UI), functional plugins (coming soon), custom previewer, and custom preloader; Just some pieces of Lua.
  🧰 Integration with fd, rg, fzf, zoxide
  πŸ’« Vim-like input/select component, auto-completion for cd paths
  🏷️ Multi-Tab Support, Scrollable Preview (for videos, PDFs, archives, directories, code, etc.)
  πŸ”„ Batch Renaming, Visual Mode, File Chooser
  🎨 Theme System, Custom Layouts, Trash Bin, CSI u

%prep
%autosetup -a1

%build
export YAZI_GEN_COMPLETIONS=true
export VERGEN_GIT_SHA=$(echo -n "%{version}" | awk -F"+" '{print $2}')
### This requires the build_rustflags global
%{cargo_build}
#####

%install
%{cargo_install -p yazi-fm}
%{cargo_install -p yazi-cli}
install -Dm 644 yazi-boot/completions/yazi.bash %{buildroot}%{_datadir}/bash-completion/completions/yazi
install -Dm 644 yazi-boot/completions/yazi.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/yazi.fish
install -Dm 644 yazi-boot/completions/_yazi %{buildroot}%{_datadir}/zsh/site-functions/_yazi

%files
%license LICENSE
%doc README.md
%{_bindir}/ya
%{_bindir}/%{name}
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/bash-completion/completions/yazi
%{_datadir}/fish/vendor_completions.d/yazi.fish
%{_datadir}/zsh/site-functions/_yazi

%changelog

openSUSE Build Service is sponsored by