File ripgrep-all.spec of Package ripgrep-all
#
# spec file for package ripgrep-all
#
# Copyright (c) 2021 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 rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
Name: ripgrep-all
Version: v0.9.6
Release: 0
Summary: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc
License: AGPL-3.0-or-later
URL: https://github.com/phiresky/ripgrep-all
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.xz
Source2: cargo_config
BuildRequires: cargo-packaging
Requires: ripgrep
Requires: fzf
%description
rga is a line-oriented search tool that allows you to look for a regex in a multitude of file types.
rga wraps the awesome ripgrep and enables it to search in pdf, docx, sqlite, jpg, movie subtitles (mkv, mp4), etc.
%prep
%setup -qa1
mkdir .cargo
cp %{SOURCE2} .cargo/config
%build
RUSTFLAGS=%{rustflags} cargo build --release
%install
RUSTFLAGS=%{rustflags} cargo install --root=%{buildroot}%{_prefix} --path .
# remove residue crate file
rm %{buildroot}%{_prefix}/.crates.toml
rm %{buildroot}%{_prefix}/.crates2.json
%files
%license LICENSE.md
%doc README.md
%{_bindir}/rga
%{_bindir}/rga-preproc
%changelog