%global debug_package %{nil}

Name: zola
Version: 0.19.1
Release: 1%{?dist}
Summary: Fast static site generator in a single binary with everything built-in

License: MIT
URL: https://github.com/getzola/zola
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires: gcc-c++
%if 0%{?el8} || 0%{?el9}
%else
BuildRequires: cargo >= 1.79
BuildRequires: rust >= 1.79
%endif

%description
%{summary}.


%prep
%autosetup -p1
%if 0%{?el8} || 0%{?el9}
curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
%endif


%install
export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_OPT_LEVEL=3
%if 0%{?el8} || 0%{?el9}
source "$HOME/.cargo/env"
%endif
cargo install --root=%{buildroot}%{_prefix} --path=.
rm -f %{buildroot}%{_prefix}/.crates.toml \
    %{buildroot}%{_prefix}/.crates2.json
strip --strip-all %{buildroot}%{_bindir}/*

%if 0%{?el9}
%dnl install -D -p -m 0644 completions/_zola %{buildroot}%{_datadir}/zsh/site-functions/_zola
%dnl install -D -p -m 0644 completions/zola.bash %{buildroot}%{_datadir}/bash-completion/completions/zola.bash
%dnl install -D -p -m 0644 completions/zola.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/zola.fish
%else
%endif


%files
%license LICENSE
%doc README.md CHANGELOG.md EXAMPLES.md CONTRIBUTING.md
%{_bindir}/%{name}
%if 0%{?el9}
%dnl %{_datadir}/bash-completion/completions/zola.bash
%dnl %{_datadir}/fish/vendor_completions.d/zola.fish
%dnl %{_datadir}/zsh/site-functions/_zola
%else
%endif


%changelog
* Tue Jun 25 2024 Artem Polishchuk <ego.cordatus@gmail.com> - 0.19.1-1
- chore: Update to latest release

* Fri Jun 21 2024 Artem Polishchuk <ego.cordatus@gmail.com> - 0.19.0-1
- chore: Update to latest release

* Sun Mar 19 2023 Artem Polishchuk <ego.cordatus@gmail.com> - 0.17.2-1
- chore(update): 0.17.2

* Fri Feb 17 2023 Artem Polishchuk <ego.cordatus@gmail.com> - 0.17.0-1
- chore(update): 0.17.0

* Sun Aug 14 2022 Artem Polishchuk <ego.cordatus@gmail.com> - 0.16.1-1
- chore(update): 0.16.1

* Mon Jan 24 2022 Artem Polishchuk <ego.cordatus@gmail.com> - 0.15.3-1
- chore(update): 0.15.3

* Sat Dec 11 2021 Artem Polishchuk <ego.cordatus@gmail.com> - 0.15.2-1
- chore(update): 0.15.2

* Mon Dec 06 2021 Artem Polishchuk <ego.cordatus@gmail.com> - 0.15.0-1
- chore(update): 0.15.0

* Sat Jan  9 2021 Artem Polishchuk <ego.cordatus@gmail.com> - 0.13.0-1
- build(update): 0.13.0

* Mon Sep 28 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.12.2-1
- Update to 0.12.2

* Sun Sep 27 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.12.1-1
- Update to 0.12.1

* Sat Sep  5 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.12.0-1
- Update to 0.12.0

* Mon May 25 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.11.0-1
- Initial package