## START: Set by rpmautospec
## (rpmautospec version 0.6.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by rust2rpm 26
%bcond_without check

# prevent library files from being installed
%global cargo_install_lib 0

%global crate asciinema
%global crate_version 3.0.0-rc.2

Name:           asciinema
Version:        3.0.0~rc.2
Release:        %autorelease
Summary:        Terminal session recorder

SourceLicense:  GPL-3.0
# (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 ISC OR MIT
# 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
# BSD-3-Clause
# GPL-3.0
# ISC
# ISC AND MIT AND OpenSSL
# MIT
# MIT AND BSD-3-Clause
# 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:        (Apache-2.0 OR MIT) AND BSD-3-Clause 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 ISC 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 GPL-3.0 AND ISC AND MIT AND OpenSSL AND (MIT OR Apache-2.0 OR Zlib) AND MPL-2.0 AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

URL:            https://github.com/asciinema/asciinema
Source:         %{url}/archive/v%{crate_version}/%{name}-%{crate_version}.tar.gz
# Manually created patch for downstream crate metadata changes
# - Temporarily relax config dependency from ^0.14 to >=0.13,<0.15
# - Bump scraper dependency from 0.15.0 to 0.19.0
Patch:          asciinema-fix-metadata.diff

BuildRequires:  cargo-rpm-macros >= 26

%global _description %{expand:
Terminal session recorder.}

%description %{_description}

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

%generate_buildrequires
%cargo_generate_buildrequires

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

%install
%cargo_install
# Install man page
install -Dpm 0644 target/release/build/%{crate}-*/out/man/asciinema.1 \
    -t %{buildroot}/%{_mandir}/man1
# Install completions
install -Dpm 0644 target/release/build/%{crate}-*/out/completion/asciinema.bash \
    -t %{buildroot}/%{bash_completions_dir}
install -Dpm 0644 target/release/build/%{crate}-*/out/completion/asciinema.fish \
    -t %{buildroot}/%{fish_completions_dir}
install -Dpm 0644 target/release/build/%{crate}-*/out/completion/_asciinema \
    -t %{buildroot}/%{zsh_completions_dir}

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

%files
%license LICENSE LICENSE.dependencies
%doc README.md CHANGELOG.md
%{_bindir}/asciinema
%{_mandir}/man1/asciinema.1*
%{bash_completions_dir}/asciinema.bash
%{fish_completions_dir}/asciinema.fish
%{zsh_completions_dir}/_asciinema

%changelog
## START: Generated by rpmautospec
* Wed May 15 2024 John Doe <packager@example.com> - 3.0.0~rc.2-1
- Uncommitted changes
## END: Generated by rpmautospec