# Generated by rust2rpm 25
%bcond_without check
%global crate sequoia-sq
Name: rust-sequoia-sq
Version: 0.32.0
Release: %autorelease
Summary: Command-line frontends for Sequoia
License: LGPL-2.0-or-later
URL: https://crates.io/crates/sequoia-sq
Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * exclude files that are only useful for upstream development
# * prevent manpages from getting installed twice
# * drop automated generation of upstream integration tests
# * drop features for unsupported crypto backends
Patch: sequoia-sq-fix-metadata.diff
# https://gitlab.com/sequoia-pgp/sequoia-sq/-/issues/163
Patch: 0001-fix-building-shell-completions-and-man-pages.patch
BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand:
Command-line frontends for Sequoia.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
# (Apache-2.0 OR MIT) AND BSD-3-Clause
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# 0BSD OR MIT OR Apache-2.0
# Apache-2.0
# Apache-2.0 AND MIT
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSD-2-Clause OR Apache-2.0 OR MIT
# BSL-1.0
# LGPL-2.0-or-later
# LGPL-3.0 OR GPL-2.0 OR GPL-3.0
# MIT
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
# MIT OR Zlib OR Apache-2.0
# MPL-2.0
# Unlicense OR MIT
# Zlib OR Apache-2.0 OR MIT
License: LGPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND BSD-3-Clause AND MIT AND MPL-2.0 AND Unicode-DFS-2016 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (LGPL-3.0 OR GPL-2.0 OR GPL-3.0) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown
%description -n %{crate} %{_description}
%files -n %{crate}
%license LICENSE.txt
%license LICENSE.dependencies
%doc README.md
%{_bindir}/sq
%{_mandir}/man1/sq*
%{bash_completions_dir}/sq.bash
%{fish_completions_dir}/sq.fish
%{zsh_completions_dir}/_sq
%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
# drop broken integration tests
rm -vr subplot/
rm -vr tests/
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%install
%cargo_install
# install manual pages
mkdir -p %{buildroot}/%{_mandir}/man1
cp -pav target/release/build/%{crate}-*/out/sq*.1 %{buildroot}/%{_mandir}/man1/
# install shell completions
install -Dpm 0644 target/release/build/%{crate}-*/out/sq.bash \
%{buildroot}/%{bash_completions_dir}/sq.bash
install -Dpm 0644 target/release/build/%{crate}-*/out/sq.fish \
%{buildroot}/%{fish_completions_dir}/sq.fish
install -Dpm 0644 target/release/build/%{crate}-*/out/_sq \
%{buildroot}/%{zsh_completions_dir}/_sq
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog