%if 0%{?fedora} %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-beanbag Version: 1.9.2 Release: 2%{?dist} Summary: A helper module for accessing REST APIs License: MIT URL: https://github.com/ajtowns/beanbag BuildArch: noarch Source0: https://pypi.python.org/packages/source/b/beanbag/beanbag-%{version}.tar.gz BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-nose BuildRequires: pytest BuildRequires: python-requests %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose BuildRequires: python3-pytest BuildRequires: python3-requests %endif # if with_python3 %description BeanBag is a simple module that lets you access REST APIs in an easy way. For example: >>> import beanbag >>> github = beanbag.BeanBag("https://api.github.com") >>> watchers = github.repos.ajtowns.beanbag.watchers() >>> for w in watchers: ... print(w["login"]) See http://beanbag.readthedocs.org/ for more information. %package -n python2-beanbag Summary: A helper module for accessing REST APIs %{?python_provide:%python_provide python2-beanbag} Requires: python-requests %description -n python2-beanbag BeanBag is a simple module that lets you access REST APIs in an easy way. For example: >>> import beanbag >>> github = beanbag.BeanBag("https://api.github.com") >>> watchers = github.repos.ajtowns.beanbag.watchers() >>> for w in watchers: ... print(w["login"]) See http://beanbag.readthedocs.org/ for more information. %package -n python3-beanbag Summary: A helper module for accessing REST APIs %{?python_provide:%python_provide python3-beanbag} Requires: python3-requests %description -n python3-beanbag BeanBag is a simple module that lets you access REST APIs in an easy way. For example: >>> import beanbag >>> github = beanbag.BeanBag("https://api.github.com") >>> watchers = github.repos.ajtowns.beanbag.watchers() >>> for w in watchers: ... print(w["login"]) See http://beanbag.readthedocs.org/ for more information. %prep %setup -q -n beanbag-%{version} %build %py2_build %if 0%{?with_python3} %py3_build %endif # with_python3 %install %py2_install %if 0%{?with_python3} %py3_install %endif # with_python3 %check %{__python2} setup.py nosetests || exit 1 %if 0%{?with_python3} %{__python3} setup.py nosetests || exit 1 %endif # with_python3 %files -n python2-beanbag %doc README.rst %license LICENSE %{python2_sitelib}/beanbag* %if 0%{?with_python3} %files -n python3-beanbag %doc README.rst %license LICENSE %{python3_sitelib}/beanbag* %endif # with_python3 %changelog * Fri Jan 08 2016 Ralph Bean - 1.9.2-2 - Some changes during package review. * Fri Jan 08 2016 Stanislav Ochotnicky - 1.9.2-1 - Initial version