File yara-x.spec of Package yara-x
#
# spec file for package yara-x
#
# Copyright (c) 2024-2025, Martin Hauke <mardnh@gmx.de>
#
# 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/
#
Name: yara-x
Version: 1.10.0
Release: 0
Summary: A malware identification and classification tool
License: BSD-3-Clause
Group: System/Filesystems
URL: https://virustotal.github.io/yara-x/
Source: https://github.com/VirusTotal/yara-x/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.zst
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: rust >= 1.78.0
%description
YARA is a tool aimed at helping malware researchers to identify and classify
malware samples. With YARA you can create descriptions of malware families
based on textual or binary patterns contained on samples of those families.
Each description consists of a set of strings and a Boolean expression which
determines its logic.
%package bash-completion
Summary: Bash Completion for %{name}
Group: System/Filesystems
Requires: %{name} = %{version}
Requires: bash-completion
Supplements: (%{name} and bash-completion)
BuildArch: noarch
%description bash-completion
Bash completion script for %{name}.
%prep
%autosetup -p 1 -a 1
%build
%{cargo_build}
%install
#%%{cargo_install}
# cargo install with workspaces is still broken
# -> https://github.com/rust-lang/cargo/issues/7599
install -Dm 0755 target/release/yr %{buildroot}%{_bindir}/yr
# create and install bash-completion
install -d %{buildroot}%{_datadir}/bash-completion/completions/
./target/release/yr completion bash > %{buildroot}%{_datadir}/bash-completion/completions/%{name}
%files
%license LICENSE
%doc README.md
%{_bindir}/yr
%files bash-completion
%{_datadir}/bash-completion/completions/%{name}
%changelog