# Generated by rust2rpm 26
%bcond_without check

%global crate zellij

Name:           rust-zellij
Version:        0.41.2
Release:        %autorelease
Summary:        Terminal workspace with batteries included

License:        MIT
URL:            https://github.com/zellij-org/zellij
Source:         %{url}/archive/refs/tags/v%{version}.tar.gz
# Loosen strict dependency version
Patch:          zellij-fix-drop-strict-version.diff
# Removed vendored curl feature, which relies on unpackaged dependencies
Patch:          zellij-remove-vendored-curl.diff
# Prevent multiple versions of dependency being used
Patch:          zellij-fix-multiple-dep-versions.diff

BuildRequires:  cargo-rpm-macros >= 24
BuildRequires:  crate(console) >= 0.14.0, crate(console) < 0.15.0

ExcludeArch:    ppc64le s390x

%global _description %{expand:
A terminal workspace with batteries included.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# Output of %%cargo_license_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 OR BSL-1.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSD-2-Clause OR Apache-2.0 OR MIT
# CC0-1.0
# CC0-1.0 OR Artistic-2.0
# ISC
# MIT
# MIT AND (MIT OR Apache-2.0)
# MIT AND Unicode-DFS-2016
# 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
# WTFPL
# Zlib OR Apache-2.0 OR MIT
# LICENSE.dependencies contains a full license breakdown
License:        ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (CC0-1.0) AND (CC0-1.0 OR Artistic-2.0) AND (ISC) AND (MIT) AND (MIT AND (MIT OR Apache-2.0)) AND (MIT AND Unicode-DFS-2016) AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND (MPL-2.0) AND (Unlicense OR MIT) AND (WTFPL) AND (Zlib OR Apache-2.0 OR MIT)

%description -n %{crate} %{_description}

%files       -n %{crate}
%license LICENSE.md
%license LICENSE.dependencies
%doc README.md
%{_bindir}/zellij
%{_datadir}/zellij

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires -a

%build
%cargo_build -a
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies

%install
%cargo_install -a
install -m 0755 -vd %{buildroot}%{_datadir}/zellij/plugins
install zellij-utils/assets/plugins/* %{buildroot}%{_datadir}/zellij/plugins

%if %{with check}
%check
%cargo_test
%endif

%changelog
%autochangelog