# Created by pyp2rpm-1.1.1 %global pypi_name Flask-RSTPages %global with_python3 1 Name: python-flask-rstpages Version: 0.3 Release: 2%{?dist} Summary: Adds support for reStructuredText to a Flask application License: BSD URL: http://flask-rstpages.readthedocs.org/ Source0: https://pypi.python.org/packages/source/F/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch Provides: Flask-RSTPages BuildRequires: python-devel BuildRequires: python-flask BuildRequires: python-sphinx %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-flask BuildRequires: python3-sphinx %endif # if with_python3 Requires: python-flask Requires: python-pygments Requires: python-docutils %description Flask-RSTPages adds support for reStructuredText to your Flask application. %if 0%{?with_python3} %package -n python3-flask-rstpages Summary: Adds support for reStructuredText to a Flask application Requires: python3-flask Requires: python3-pygments Requires: python3-docutils %description -n python3-flask-rstpages Flask-RSTPages adds support for reStructuredText to your Flask application. %endif # with_python3 %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # generate html docs sphinx-build docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' # generate html docs sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %endif # with_python3 find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %{__python2} setup.py install --skip-build --root %{buildroot} %files %doc html LICENSE %{python2_sitelib}/flask_rstpages %{python2_sitelib}/Flask_RSTPages-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-flask-rstpages %doc html LICENSE %{python3_sitelib}/flask_rstpages %{python3_sitelib}/Flask_RSTPages-%{version}-py?.?.egg-info %endif # with_python3 %changelog * Thu Oct 16 2014 Richard Marko - 0.3-2 - Corrected packaging errors. * Wed Oct 01 2014 Richard Marko - 0.3-1 - Initial package.