From bffba3684eb6b2814744bc18df3d2ae589a4bee7 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 05 2014 20:26:14 +0000 Subject: Initial import (#1160447) --- diff --git a/.gitignore b/.gitignore index e69de29..fd3216e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/txrequests-0.9.2.tar.gz diff --git a/python-txrequests.spec b/python-txrequests.spec new file mode 100644 index 0000000..c80d66a --- /dev/null +++ b/python-txrequests.spec @@ -0,0 +1,113 @@ +%if 0%{?fedora} +# Upstream is not ready to support python3 yet, so we turn it off. +%global with_python3 0 +%endif + +%{!?_licensedir: %global license %%doc} + +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?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 + +%global modname txrequests + +Name: python-txrequests +Version: 0.9.2 +Release: 1%{?dist} +Summary: Asynchronous Python HTTP for Humans + +Group: Development/Libraries +License: ASL 2.0 +URL: http://pypi.python.org/pypi/txrequests +Source0: https://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz + +BuildArch: noarch + +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python-requests +BuildRequires: python-twisted-core + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-requests +BuildRequires: python3-twisted-core +%endif + +Requires: python-requests +Requires: python-twisted-core + +%description +This is a small add-on for the python requests HTTP library. It makes use +twisted's ThreadPool, so that requests' API returns deferreds. + +The additional API and changes are minimal and strive to avoid surprises. + +%if 0%{?with_python3} +%package -n python3-txrequests +Summary: Asynchronous Python HTTP for Humans. +Group: Development/Libraries + +Requires: python3-requests +Requires: python3-twisted-core + +%description -n python3-txrequests +This is a small add-on for the python requests HTTP library. It makes use +twisted's ThreadPool, so that requests' API returns deferreds. + +The additional API and changes are minimal and strive to avoid surprises. +%endif + +%prep +%setup -q -n %{modname}-%{version} + +# Remove bundled egg-info in case it exists +rm -rf %{modname}.egg-info +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + +%build +%{__python2} setup.py build +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + +%install +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root=%{buildroot} +popd +%endif +%{__python2} setup.py install -O1 --skip-build --root=%{buildroot} + +%check +%{__python2} setup.py test +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py test +popd +%endif + +%files +%doc README.rst +%license LICENSE +%{python2_sitelib}/%{modname}/ +%{python2_sitelib}/%{modname}-%{version}* + +%if 0%{?with_python3} +%files -n python3-txrequests +%doc README.rst +%license LICENSE +%{python3_sitelib}/%{modname}/ +%{python3_sitelib}/%{modname}-%{version}* +%endif + +%changelog +* Tue Nov 04 2014 Ralph Bean - 0.9.2-1 +- Initial package for Fedora diff --git a/sources b/sources index e69de29..33a0ece 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2657bd814099ee4ba160daa5b058f3f3 txrequests-0.9.2.tar.gz