Blame python-sphinx-notfound-page.spec

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