%if 0%{?fedora} > 12 %global with_python3 1 %else %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: python-flask-cache Version: 0.13.1 Release: 2%{?dist} Summary: Adds cache support to your Flask application License: BSD URL: https://github.com/thadeusb/flask-cache Source0: https://pypi.python.org/packages/source/F/Flask-Cache/Flask-Cache-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-flask BuildRequires: python-setuptools Requires: python-flask %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-flask BuildRequires: python3-setuptools Requires: python3-flask %endif Provides: python2-flask-cache %description %{summary}. %package doc Summary: Documentation for the Flask-Cache module BuildRequires: python-sphinx %description doc Documentation for the Flask-Cache module %if 0%{?with_python3} %package -n python3-flask-cache Summary: Adds cache support to your Flask application License: BSD %description -n python3-flask-cache %{summary}. %package -n python3-flask-cache-doc Summary: Documentation for the Flask-Cache module BuildRequires: python3-sphinx %description -n python3-flask-cache-doc Documentation for the Flask-Cache module %endif %prep %setup -qc mv Flask-Cache-%{version} python2 pushd python2 rm -rf *.egg-info cp -pr CHANGES PKG-INFO README LICENSE ../ popd %if 0%{?with_python3} cp -a python2 python3 %endif %build pushd python2 %{__python2} setup.py build # Build documentation pushd docs sphinx-build -b html -d build/doctrees . build/html popd popd %if 0%{?with_python3} pushd python3 %{__python3} setup.py build # Build documentation pushd docs sphinx-build-3 -b html -d build/doctrees . build/html popd popd %endif %install %if 0%{?with_python3} pushd python3 %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif pushd python2 %{__python2} setup.py install -O1 --skip-build --root %{buildroot} popd %check pushd python2 %{__python2} test_cache.py popd %if 0%{?with_python3} pushd python3 %{__python3} test_cache.py popd %endif %files %doc CHANGES PKG-INFO README %license LICENSE %{python2_sitelib}/flask_cache %{python2_sitelib}/Flask_Cache-%{version}-py2.?.egg-info %files doc %doc python2/docs/build/html %if 0%{?with_python3} %files -n python3-flask-cache %doc CHANGES PKG-INFO README %license LICENSE %{python3_sitelib}/flask_cache %{python3_sitelib}/Flask_Cache-%{version}-py3.?.egg-info %files -n python3-flask-cache-doc %doc python3/docs/build/html %endif %changelog * Sun Jul 05 2015 Piotr Popieluch - 0.13.1-2 - Addressed comments from review * Fri Jul 03 2015 Piotr Popieluch - 0.13.1-1 - Initial package