Blame python-txrequests.spec

bffba36
%if 0%{?fedora}
bffba36
# Upstream is not ready to support python3 yet, so we turn it off.
bffba36
%global with_python3 0
bffba36
%endif
bffba36
bffba36
%{!?_licensedir: %global license %%doc}
bffba36
bffba36
%if 0%{?rhel} && 0%{?rhel} <= 6
bffba36
%{!?__python2:        %global __python2 /usr/bin/python2}
bffba36
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
bffba36
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
bffba36
%endif
bffba36
bffba36
%global modname txrequests
bffba36
bffba36
Name:               python-txrequests
bffba36
Version:            0.9.2
2c23c78
Release:            5%{?dist}
bffba36
Summary:            Asynchronous Python HTTP for Humans
bffba36
bffba36
Group:              Development/Libraries
bffba36
License:            ASL 2.0
bffba36
URL:                http://pypi.python.org/pypi/txrequests
bffba36
Source0:            https://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz
bffba36
bffba36
BuildArch:          noarch
bffba36
bffba36
BuildRequires:      python2-devel
bffba36
BuildRequires:      python-setuptools
bffba36
BuildRequires:      python-requests
bffba36
BuildRequires:      python-twisted-core
bffba36
bffba36
%if 0%{?with_python3}
bffba36
BuildRequires:      python3-devel
bffba36
BuildRequires:      python3-requests
bffba36
BuildRequires:      python3-twisted-core
bffba36
%endif
bffba36
bffba36
Requires:           python-requests
bffba36
Requires:           python-twisted-core
bffba36
bffba36
%description
bffba36
This is a small add-on for the python requests HTTP library.  It makes use
bffba36
twisted's ThreadPool, so that requests' API returns deferreds.
bffba36
bffba36
The additional API and changes are minimal and strive to avoid surprises.
bffba36
bffba36
%if 0%{?with_python3}
bffba36
%package -n python3-txrequests
bffba36
Summary:            Asynchronous Python HTTP for Humans.
bffba36
Group:              Development/Libraries
bffba36
bffba36
Requires:           python3-requests
bffba36
Requires:           python3-twisted-core
bffba36
bffba36
%description -n python3-txrequests
bffba36
This is a small add-on for the python requests HTTP library.  It makes use
bffba36
twisted's ThreadPool, so that requests' API returns deferreds.
bffba36
bffba36
The additional API and changes are minimal and strive to avoid surprises.
bffba36
%endif
bffba36
bffba36
%prep
bffba36
%setup -q -n %{modname}-%{version}
bffba36
471aaa9
# Nuke this req for epel7
471aaa9
sed -i '/twisted/d' setup.py
471aaa9
c9b6328
# Furthermore, un-pin this for epel7.
c9b6328
# See https://bugzilla.redhat.com/show_bug.cgi?id=1177503
c9b6328
sed -i 's/requests>=1.2.0/requests>=1.1.0/g' setup.py
c9b6328
bffba36
# Remove bundled egg-info in case it exists
bffba36
rm -rf %{modname}.egg-info
bffba36
%if 0%{?with_python3}
bffba36
rm -rf %{py3dir}
bffba36
cp -a . %{py3dir}
bffba36
%endif
bffba36
bffba36
%build
bffba36
%{__python2} setup.py build
bffba36
%if 0%{?with_python3}
bffba36
pushd %{py3dir}
bffba36
%{__python3} setup.py build
bffba36
popd
bffba36
%endif
bffba36
bffba36
%install
bffba36
%if 0%{?with_python3}
bffba36
pushd %{py3dir}
bffba36
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
bffba36
popd
bffba36
%endif
bffba36
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
bffba36
bffba36
%check
bffba36
%{__python2} setup.py test
bffba36
%if 0%{?with_python3}
bffba36
pushd %{py3dir}
bffba36
%{__python3} setup.py test
bffba36
popd
bffba36
%endif
bffba36
bffba36
%files
bffba36
%doc README.rst
bffba36
%license LICENSE
bffba36
%{python2_sitelib}/%{modname}/
bffba36
%{python2_sitelib}/%{modname}-%{version}*
bffba36
bffba36
%if 0%{?with_python3}
bffba36
%files -n python3-txrequests
bffba36
%doc README.rst
bffba36
%license LICENSE
bffba36
%{python3_sitelib}/%{modname}/
bffba36
%{python3_sitelib}/%{modname}-%{version}*
bffba36
%endif
bffba36
bffba36
%changelog
2c23c78
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-5
2c23c78
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2c23c78
d9db1fb
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-4
d9db1fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
d9db1fb
c9b6328
* Mon Jan 05 2015 Ralph Bean <rbean@redhat.com> - 0.9.2-3
c9b6328
- Un-pin another requirement for epel7.
c9b6328
471aaa9
* Wed Nov 05 2014 Ralph Bean <rbean@redhat.com> - 0.9.2-2
471aaa9
- Nuke a requirement for epel7.
471aaa9
bffba36
* Tue Nov 04 2014 Ralph Bean <rbean@redhat.com> - 0.9.2-1
bffba36
- Initial package for Fedora