%global pypi_name django-formtools %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 1.0 Release: 4%{?dist} Summary: A set of high-level abstractions for Django forms License: BSD URL: http://django-formtools.readthedocs.org/en/latest/ Source0: https://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description Django's "formtools" is a set of high-level abstractions for Django forms. Currently for form previews and multi-step forms. %package -n python2-%{pypi_name} Summary: A set of high-level abstractions for Django forms %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-sphinx BuildRequires: python-django >= 1.7 # Required for testing BuildRequires: python-flake8 BuildRequires: python-coverage Requires: python-django >= 1.7 %description -n python2-%{pypi_name} Django's "formtools" is a set of high-level abstractions for Django forms. Currently for form previews and multi-step forms. %package -n python2-%{pypi_name}-doc Summary: A set of high-level abstractions for Django forms - documentation %{?python_provide:%python_provide python2-%{pypi_name}-doc} Requires: python2-%{pypi_name} = %{version}-%{release} %description -n python2-%{pypi_name}-doc Django's "formtools" is a set of high-level abstractions for Django forms. This is the associated documentation. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: A set of high-level abstractions for Django forms %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-sphinx BuildRequires: python3-django >= 1.7 # Required for testing BuildRequires: python3-flake8 BuildRequires: python3-coverage Requires: python3-django >= 1.7 %description -n python3-%{pypi_name} Django's "formtools" is a set of high-level abstractions for Django forms. Currently for form previews and multi-step forms. %package -n python3-%{pypi_name}-doc Summary: A set of high-level abstractions for Django forms - documentation %{?python_provide:%python_provide python3-%{pypi_name}-doc} Requires: python3-%{pypi_name} = %{version}-%{release} %description -n python3-%{pypi_name}-doc Django's "formtools" is a set of high-level abstractions for Django forms. This is the associated documentation. %endif %prep %setup -q -n %{pypi_name}-%{version} %build %{py2_build} %if 0%{?with_python3} %{py3_build} %endif %check %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif %install %{py2_install} %find_lang django py2lang # generate html docs sphinx-build docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} %{py3_install} %find_lang django py3lang %endif %files -n python2-%{pypi_name} -f py2lang %doc README.rst %license LICENSE %{python2_sitelib}/formtools %{python2_sitelib}/django_formtools-%{version}-py?.?.egg-info %files -n python2-%{pypi_name}-doc %doc html %license LICENSE %if 0%{?with_python3} %files -n python3-%{pypi_name} -f py3lang %doc README.rst %license LICENSE %{python3_sitelib}/formtools %{python3_sitelib}/django_formtools-%{version}-py?.?.egg-info # find_lang will find both python2 and python3 locale files %exclude %{python2_sitelib}/formtools/locale %files -n python3-%{pypi_name}-doc %doc html %license LICENSE %endif %changelog * Thu Sep 10 2015 jpena - 1.0-4 - Moved documentation into a subpackage * Wed Sep 09 2015 jpena - 1.0-3 - Handle locale files properly * Wed Sep 09 2015 jpena - 1.0-2 - Fixed python3 conditional in files section - Added checks - Moved sphinx-build to install section * Tue Sep 08 2015 jpena - 1.0-1 - Initial package.