%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %if (0%{?fedora} > 12) %global with_python3 1 %endif %global pkgname python-flask-restful %global tarball_name flask-restful Name: python-flask-restful Version: 0.3.3 Release: 1%{?dist} Summary: Simple framework for creating REST APIs for Flask Group: Development/Languages License: BSD URL: https://www.github.com/twilio/flask-restful/ Source0: https://github.com/flask-restful/%{tarball_name}/archive/%{version}.tar.gz Patch0: remove_q0_testcase.patch BuildArch: noarch Requires: python-flask Requires: python-six Requires: python-aniso8601 Requires: pytz # those are needed for tests: BuildRequires: python-flask BuildRequires: python-six BuildRequires: python-aniso8601 BuildRequires: pytz BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-nose BuildRequires: python-mock BuildRequires: python-blinker BuildRequires: python-crypto %description Flask-RESTful is Python 2 extension for Flask that adds support for quickly building REST APIs. It is a lightweight abstraction that works with your existing ORM/libraries. %if 0%{?with_python3} %package -n python3-flask-restful Summary: %{summary} Requires: python3-flask Requires: python3-six Requires: python3-aniso8601 Requires: python3-pytz # those are needed for tests: BuildRequires: python3-flask BuildRequires: python3-six BuildRequires: python3-aniso8601 BuildRequires: python3-pytz BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose BuildRequires: python3-mock BuildRequires: python3-blinker BuildRequires: python3-crypto %description -n python3-flask-restful Flask-RESTful is Python 3 extension for Flask that adds support for quickly building REST APIs. It is a lightweight abstraction that works with your existing ORM/libraries. %endif %prep %setup -qn %{tarball_name}-%{version} rm -rf docs/_themes/.gitignore %patch0 -p1 %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif %check %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif %files %doc AUTHORS.md README.md examples/ docs/ %license LICENSE %{python2_sitelib}/* %if 0%{?with_python3} %files -n python3-flask-restful %doc AUTHORS.md README.md examples/ docs/ %license LICENSE %{python3_sitelib}/* %endif %changelog * Tue Jul 07 2015 Jan Sedlak - 0.3.3-1 - package newest version * Wed Jan 22 2014 Jan Sedlak - 0.2.11-1 - initial packaging