fa1faa
%global srcname autopage
fa1faa
fa1faa
# Macros for pyproject (Fedora) vs. setup.py (CentOS)
fa1faa
%if 0%{?fedora}
fa1faa
%bcond_without pyproject
fa1faa
%else
fa1faa
%bcond_with pyproject
fa1faa
%endif
fa1faa
fa1faa
Name:           python-%{srcname}
fa1faa
Version:        0.4.0
fa1faa
Release:        1%{?dist}
fa1faa
Summary:        A Python library to provide automatic paging for console output
fa1faa
License:        ASL 2.0
fa1faa
URL:            https://pypi.python.org/pypi/autopage
fa1faa
Source0:        %{pypi_source}
fa1faa
Source1:        setup.py
fa1faa
fa1faa
BuildArch:      noarch
fa1faa
fa1faa
%global _description %{expand:
fa1faa
Autopage is a Python library to provide automatic paging for console output.}
fa1faa
fa1faa
fa1faa
%description %_description
fa1faa
fa1faa
%package -n python3-%{srcname}
fa1faa
Summary:        %{summary}
fa1faa
BuildRequires:  python3-devel
fa1faa
%if %{with pyproject}
fa1faa
BuildRequires:  pyproject-rpm-macros
fa1faa
%else
fa1faa
BuildRequires:  %{py3_dist fixtures}
fa1faa
%endif
fa1faa
fa1faa
%description -n python3-%{srcname} %_description
fa1faa
fa1faa
%prep
fa1faa
%autosetup -n %{srcname}-%{version}
fa1faa
fa1faa
%if %{with pyproject}
fa1faa
%generate_buildrequires
fa1faa
%pyproject_buildrequires -e pep8,%{toxenv}
fa1faa
%else
fa1faa
cp %{SOURCE1} ./
fa1faa
%endif
fa1faa
fa1faa
%build
fa1faa
%if %{with pyproject}
fa1faa
%pyproject_wheel
fa1faa
%else
fa1faa
%py3_build
fa1faa
%endif
fa1faa
fa1faa
%install
fa1faa
%if %{with pyproject}
fa1faa
%pyproject_install
fa1faa
%pyproject_save_files autopage
fa1faa
%else
fa1faa
%py3_install
fa1faa
%endif
fa1faa
fa1faa
%check
fa1faa
%if %{with pyproject}
fa1faa
%tox
fa1faa
%else
fa1faa
%{python3} setup.py test
fa1faa
%endif
fa1faa
fa1faa
%if %{with pyproject}
fa1faa
%files -n python3-%{srcname} -f %{pyproject_files}
fa1faa
%else
fa1faa
%files -n python3-%{srcname}
fa1faa
%{python3_sitelib}/%{srcname}-*.egg-info/
fa1faa
%{python3_sitelib}/%{srcname}/
fa1faa
%endif
fa1faa
%license LICENSE
fa1faa
%doc README.md
fa1faa
fa1faa
%changelog
fa1faa
* Mon Jul 12 2021 Zane Bitter <zaneb@fedoraproject.org> 0.4.0-1
fa1faa
- Update to v0.4.0
fa1faa
fa1faa
* Fri Jun 25 2021 Zane Bitter <zaneb@fedoraproject.org> 0.3.1-1
fa1faa
- Update to v0.3.1 for easier packaging
fa1faa
fa1faa
* Fri Jun 25 2021 Zane Bitter <zaneb@fedoraproject.org> 0.3.0-2
fa1faa
- Support building for EPEL
fa1faa
fa1faa
* Fri Jun 18 2021 Zane Bitter <zaneb@fedoraproject.org> 0.3.0-1
fa1faa
- Initial build