rust-sequoia-sqv/rust-sequoia-sqv.spec
Daiki Ueno edace736d6 Initial import from Fedora
Resolves: RHEL-45856
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-08-19 16:37:21 +09:00

122 lines
3.6 KiB
RPMSpec

# Generated by rust2rpm 26
%bcond_without check
%global crate sequoia-sqv
%if 0%{?rhel}
# RHEL: Use bundled deps as it doesn't ship Rust libraries
%global bundled_rust_deps 1
%global __brp_mangle_shebangs_exclude_from ^/usr/src/debug/.*$
%else
# Fedora: Use only system Rust libraries
%global bundled_rust_deps 0
%endif
Name: rust-sequoia-sqv
Version: 1.2.1
Release: %autorelease
Summary: Simple OpenPGP signature verification program
License: GPL-2.0-or-later
URL: https://crates.io/crates/sequoia-sqv
Source0: %{crates_source}
# Generated using cargo-vendor-filterer:
# cargo download %%{crate}==%%{version} > %%{crate}-%%{version}.crate
# tar xf %%{crate}-%%{version}.crate
# pushd %%{crate}-%%{version}
# cargo vendor-filterer --platform x86_64-unknown-linux-gnu \
# --platform powerpc64le-unknown-linux-gnu \
# --platform aarch64-unknown-linux-gnu \
# --platform i686-unknown-linux-gnu \
# --platform s390x-unknown-linux-gnu \
# --all-features=true
Source1: %{name}-%{version}-vendor.tar.xz
# Manually created patch for downstream crate metadata changes
# * switch crypto backend from Nettle to OpenSSL
# * exclude files that are only useful for upstream development
# * drop features for unsupported crypto backends
Patch: sequoia-sqv-fix-metadata.diff
ExclusiveArch: %{rust_arches}
%if 0%{?bundled_rust_deps}
BuildRequires: rust-toolset
# vendored openssl-sys
BuildRequires: openssl-devel
%else
BuildRequires: cargo-rpm-macros >= 24
%endif
%global _description %{expand:
A simple OpenPGP signature verification program.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# Apache-2.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSL-1.0
# GPL-2.0-or-later
# LGPL-2.0-or-later
# MIT
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
# Unlicense OR MIT
# Zlib OR Apache-2.0 OR MIT
License: GPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND LGPL-2.0-or-later AND MIT AND Unicode-DFS-2016 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) 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}/sqv
%{_mandir}/man1/sqv*
%{bash_completions_dir}/sqv.bash
%{fish_completions_dir}/sqv.fish
%{zsh_completions_dir}/_sqv
%prep
%autosetup -n %{crate}-%{version} -N %{?bundled_rust_deps:-a1}
%autopatch -M 99 -p1
%if 0%{?bundled_rust_deps}
%cargo_prep -v vendor
%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%endif
%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/man-pages/sqv*.1 %{buildroot}/%{_mandir}/man1/
# install shell completions
install -Dpm 0644 target/release/build/%{crate}-*/out/shell-completions/sqv.bash \
%{buildroot}/%{bash_completions_dir}/sqv.bash
install -Dpm 0644 target/release/build/%{crate}-*/out/shell-completions/sqv.fish \
%{buildroot}/%{fish_completions_dir}/sqv.fish
install -Dpm 0644 target/release/build/%{crate}-*/out/shell-completions/_sqv \
%{buildroot}/%{zsh_completions_dir}/_sqv
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog