## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 4;
    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

Name:           vit
%global forgeurl https://github.com/scottkosty/%{name}
Version:        2.3.2
Release:        %autorelease
Summary:        Visual Interactive Taskwarrior full-screen terminal interface

%forgemeta

License:        MIT
URL:            %forgeurl
Source0:        %forgesource

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  help2man
BuildRequires:  task
Requires:       task

%{?python_provide:%python_provide python3-vit}

%description
Features:
- Fully-customizable key bindings (default Vim-like)
- Uncluttered display
- No mouse
- Speed
- Per-column colorization
- Advanced tab completion
- Multiple/customizable themes
- Override/customize column formatters
- Intelligent sub-project indenting


%prep
%forgesetup
rm -rf vit.egg-info

# Comment out to remove /usr/bin/env shebangs
# Can use something similar to correct/remove /usr/bin/python shebangs also
find vit/ -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files vit

# Install bashcompletion
install -m 0644 -p -D -t  $RPM_BUILD_ROOT/%{_datadir}/bash-completion/completions/vit/ scripts/bash/%{name}.bash_completion

# generate man pages
for binary in "vit"
do
    echo "Generating man page for ${binary// /-/}"
    PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python3_sitelib}/" PATH="$PATH:%{buildroot}/%{_bindir}/" help2man --no-info --no-discard-stderr --name="${binary}" --version-string="${binary} %{version}" --output="${binary// /-}.1" "${binary}"
    cat "${binary// /-}.1"
    install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary// /-}.1"
done
%check
LC_ALL=C PYTHONPATH=. %{__python3} -m unittest

%files -f %{pyproject_files}
%doc README.md CUSTOMIZE.md COLOR.md DEVELOPMENT.md UPGRADE.md
%{_bindir}/%{name}
%{_datadir}/bash-completion/completions/%{name}
%{_mandir}/man1/vit*

%changelog
## START: Generated by rpmautospec
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 2.3.2-3
- Rebuilt for Python 3.13

* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Nov 05 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 2.3.2-1
- feat: update to 2.3.2

* Sun Nov 05 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 2.3.1-3
- chore: add packit

* Sun Sep 17 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 2.3.1-2
- fix: for py3.12

* Fri Jul 28 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 2.3.1-1
- feat: update to 2.3.1 (fixes rhbz#2217400, rhbz#2220621, rhbz#2226500)

* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.3.0-2
- Rebuilt for Python 3.12

* Thu May 18 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 2.3.0-1
- feat: update to 2.3.0 (fixes rhbz#2186958)

* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Jul 27 2022 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.0-1
- Update to latest release

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-13.20200430git7200949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.0-12.20200430git7200949
- Rebuilt for Python 3.11

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

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

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.0.0-9.20200430git7200949
- Rebuilt for Python 3.10

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

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

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-6.20200430git7200949
- Rebuilt for Python 3.9

* Thu Apr 30 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.0-5.20200430git7200949
- Update to latest upstream snapshot

* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Mon Oct 07 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.0-3
- Include upgrade from github repo---not included in pypi tarball

* Mon Oct 07 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.0-2
- Update license
- Add UPGRADE.md

* Mon Oct 07 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.0-1
- Update to 2.0.0

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.8.0b2
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.7.0b2
- Rebuilt for Python 3.8

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.6.0b2
- Rebuilt for Python 3.8

* Mon Aug 19 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0-0.5.0b2
- Update to beta 2
- Drop patch, merged upstream
- Remove requirements file, now included in pypi tar

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.4.0b1
- Rebuilt for Python 3.8

* Sun Aug 04 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0-0.3.0b1
- Fix bash completion

* Sun Aug 04 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0-0.2.0b1
- Add patch to fix import bug
- Correct tests

* Sun Aug 04 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0-0.1.0b1
- Update to new version
- Moved to Python

* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-0.3.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-0.2.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Aug 28 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3-0.1.beta1
- Update to 1.3.beta1
- Remove unneeded patches
- Use github tarball
- Use make_build

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Feb 17 2016 Ralf Corsépius <corsepiu@fedoraproject.org> - 1.2-4
- Add BR: perl(Time::HiRes) (FT24FTBFS, RHBZ#1308231).
- Add %%license.

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Jul 11 2014 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.2-1
- Update as per reviewer comments - rhbz1112072

* Tue Jun 24 2014 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.2-1
- Update to new 1.2 stable version

* Mon Jun 23 2014 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.2-0.1.beta1
- Initial rpmbuild

## END: Generated by rpmautospec