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

# Generated by rust2rpm 20
# The rstest dev-dependency has cyclic deps
%bcond_with check

%global crate zoxide

Name:           rust-%{crate}
Version:        0.8.0
Release:        %autorelease
Summary:        Smarter cd command for your terminal

# Upstream license specification: MIT
License:        MIT
URL:            https://crates.io/crates/zoxide
Source:         %{crates_source}
# Initial patched metadata
# * Update clap to 3.0.0, https://github.com/ajeetdsouza/zoxide/commit/b6b024c452635d672e3dc58707ef86cb944a52ab
Patch0:         zoxide-fix-metadata.diff
Patch1:         0001-port-from-clap_generate-to-clap_complete.patch

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging

%global _description %{expand:
Smarter cd command for your terminal.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
# ASL 2.0 or MIT
# CC0
# MIT
# MIT or ASL 2.0
# Unlicense or MIT
License:        MIT and CC0
# For interactive mode
Recommends:     fzf

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

%files       -n %{crate}
%license LICENSE
%doc CHANGELOG.md README.md
%{_bindir}/zoxide

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

%generate_buildrequires
%cargo_generate_buildrequires
%if %{with check}
echo '/usr/bin/bash'
echo '/usr/bin/fish'
echo '/usr/bin/shellcheck'
echo '/usr/bin/xonsh'
echo '/usr/bin/zsh'
%endif

%build
%cargo_build

%install
%cargo_install

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

%changelog
* Sat Jan 29 2022 Fabio Valentini <decathorpe@gmail.com> 0.8.0-2
- Finish port from clap_generate to clap_complete

* Sat Jan 29 2022 Igor Raits <igor.raits@gmail.com> 0.8.0-1
- Update to 0.8.0 (Closes: rhbz#2035586)

* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.7.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Nov 17 2021 Robert-André Mauchin <zebob.m@gmail.com> 0.7.9-1
- Update to 0.7.9 Close: rhbz#1947669

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Dec 29 17:14:03 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.5.0-1
- Update to 0.5.0 (Fixes: RHBZ#1893357)

* Mon Dec 28 13:34:03 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.4.3-2
- Rebuild

* Wed Aug 26 2020 Josh Stone <jistone@redhat.com> - 0.4.3-1
- Update to 0.4.3

* Sun Aug 16 15:02:00 GMT 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.4.1-4
- Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Sun Jun 07 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.4.1-2
- Recommends: fzf

* Mon May 25 07:37:22 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.4.1-1
- Update to 0.4.1

* Thu May 14 15:19:09 CEST 2020 Igor Raits <i.gnatenko.brain@gmail.com> - 0.4.0-1
- Initial package