69ed225
%global pypi_name sphinx-notfound-page
69ed225
%global srcname sphinx_notfound_page
69ed225
%global importname notfound
69ed225
%global project_owner readthedocs
69ed225
%global github_name sphinx-notfound-page
69ed225
%global desc Create a custom 404 page with absolute URLs hardcoded
69ed225
69ed225
%if 0%{?fedora} > 30 || 0%{?rhel} > 7
69ed225
%bcond_with python2
69ed225
%else
69ed225
%bcond_without python2
69ed225
%endif
69ed225
69ed225
Name:           python-%{pypi_name}
69ed225
Version:        0.4
69ed225
Release:        5%{?dist}
69ed225
Summary:        Create a custom 404 page with absolute URLs hardcoded
69ed225
69ed225
License:        MIT
69ed225
URL:            https://pypi.python.org/pypi/%{pypi_name}
69ed225
Source0:        https://github.com/%{project_owner}/%{github_name}/archive/%{version}.tar.gz
69ed225
69ed225
BuildArch:      noarch
69ed225
69ed225
%description
69ed225
%desc
69ed225
69ed225
%if %{with python2}
69ed225
%package -n python2-%{pypi_name}
69ed225
Summary:        %{summary}
69ed225
BuildRequires:  python2-devel
69ed225
BuildRequires:  python2-setuptools
69ed225
BuildRequires:  python2-sphinx
69ed225
BuildRequires:  python2-pytest
69ed225
Requires:       python2-setuptools
69ed225
Requires:       python2-sphinx
69ed225
%{?python_provide:%python_provide python2-%{pypi_name}}
69ed225
69ed225
%description -n python2-%{pypi_name}
69ed225
%desc
69ed225
%endif
69ed225
69ed225
%package -n     python%{python3_pkgversion}-%{pypi_name}
69ed225
Summary:        %{summary}
69ed225
BuildArch:      noarch
69ed225
BuildRequires:  python%{python3_pkgversion}-devel
69ed225
BuildRequires:  python%{python3_pkgversion}-setuptools
69ed225
BuildRequires:  python%{python3_pkgversion}-sphinx
69ed225
BuildRequires:  python3-pytest
69ed225
Requires(post): %{_sbindir}/update-alternatives
69ed225
Requires(postun): %{_sbindir}/update-alternatives
69ed225
Requires:       python%{python3_pkgversion}-setuptools
69ed225
Requires:       python%{python3_pkgversion}-sphinx
69ed225
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
69ed225
69ed225
%description -n python%{python3_pkgversion}-%{pypi_name}
69ed225
%desc
69ed225
69ed225
69ed225
%prep
69ed225
%autosetup -n %{pypi_name}-%{version} -p1
69ed225
69ed225
%build
69ed225
%if %{with python2}
69ed225
%py2_build
69ed225
%endif
69ed225
%py3_build
69ed225
69ed225
69ed225
%install
69ed225
%if %{with python2}
69ed225
%py2_install
69ed225
%endif
69ed225
69ed225
%py3_install
69ed225
69ed225
%check
69ed225
%if %{with python2}
69ed225
PYTHONPATH="$(pwd)" py.test-%{python2_version} -v .
69ed225
%endif
69ed225
PYTHONPATH="$(pwd)" py.test-%{python3_version} -v .
69ed225
69ed225
%if %{with python2}
69ed225
%files -n python2-%{pypi_name}
69ed225
%license LICENSE
69ed225
%doc README.rst CHANGELOG.rst docs
69ed225
%{python2_sitelib}/%{srcname}-%{version}*-py%{python2_version}.egg-info/
69ed225
%{python2_sitelib}/%{importname}/
69ed225
%endif
69ed225
69ed225
%files -n python%{python3_pkgversion}-%{pypi_name}
69ed225
%license LICENSE
69ed225
%doc README.rst CHANGELOG.rst docs
69ed225
%{python3_sitelib}/%{srcname}-%{version}*-py%{python3_version}.egg-info/
69ed225
%{python3_sitelib}/%{importname}/
69ed225
69ed225
%changelog
69ed225
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4-5
69ed225
- Rebuilt for Python 3.8.0rc1 (#1748018)
69ed225
69ed225
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4-4
69ed225
- Rebuilt for Python 3.8
69ed225
69ed225
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-3
69ed225
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
69ed225
69ed225
* Sat Jul 13 2019 Kevin Fenzi <kevin@scrye.com> - 0.4-2
69ed225
- Use bcond for python2 support.
69ed225
69ed225
* Wed Jul 03 2019 Kevin Fenzi <kevin@scrye.com> - 0.4-1
69ed225
- Initial version for Fedora.