%global bin_name rg Name: ripgrep Version: 15.1.0 Release: 1%{?dist} Summary: ripgrep recursively searches directories for a regex pattern while respecting your gitignore License: MIT AND Unlicense URL: https://github.com/BurntSushi/ripgrep Source0: https://github.com/BurntSushi/ripgrep/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: rust-toolset %description %{summary} %package bash-completion Summary: Bash completion files for %{name} Requires: bash-completion Requires: %{name}%{?_isa} = %{version}-%{release} %description bash-completion Bash completion scripts for %{name}. %package fish-completion Summary: Fish completion files for %{name} Requires: fish Requires: %{name}%{?_isa} = %{version}-%{release} %description fish-completion Fish completion scripts for %{name}. %prep %autosetup -p1 %build source /opt/rh/rust-toolset/enable cargo build --release --features pcre2 target/release/%{bin_name} --generate man > %{bin_name}.1 target/release/%{bin_name} --generate complete-bash > %{bin_name}.bash target/release/%{bin_name} --generate complete-fish > %{bin_name}.fish gzip %{bin_name}.1 # ----------------------- # Install # ----------------------- %install install -Dpm 0755 target/release/%{bin_name} %{buildroot}%{_bindir}/%{bin_name} install -Dpm 0644 %{bin_name}.1.gz %{buildroot}%{_mandir}/man1/%{bin_name}.1.gz install -Dpm 0644 %{bin_name}.bash %{buildroot}%{bash_completions_dir}/%{bin_name} install -Dpm 0644 %{bin_name}.fish %{buildroot}%{fish_completions_dir}/%{bin_name}.fish # ----------------------- # Test # ----------------------- %check source /opt/rh/rust-toolset/enable cargo test --release --locked # ----------------------- # Files # ----------------------- %files %{_bindir}/%{bin_name} %{_mandir}/man1/%{bin_name}.1.gz %files bash-completion %{bash_completions_dir}/%{bin_name} %files fish-completion %{fish_completions_dir}/%{bin_name}.fish %changelog %autochangelog