LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-urllib3.spec of Package python-urllib3 (Project home:lenovo-lico:lico-dep:5.1:el6)

%{!?_licensedir:%global license %%doc}
%global srcname urllib3

Name:           python-%{srcname}
Version:        1.22
Release:        4%{?dist}
Summary:        Python HTTP library with thread-safe connection pooling and file post

License:        MIT
URL:            https://github.com/shazow/urllib3
Source0:        https://pypi.io/packages/source/u/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  epel-rpm-macros
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  python-backports-ssl_match_hostname

%description
Python HTTP module with connection pooling and file POST abilities.

%package -n python2-%{srcname}
Summary:        Python2 HTTP library with thread-safe connection pooling and file post
%{?python_provide:%python_provide python2-%{srcname}}

Requires:       ca-certificates

# Previously bundled things:
Requires:       python2-six
Requires:       python-backports-ssl_match_hostname

# Secure extra requirements
Requires:       python2-pyOpenSSL
Requires:       python2-cryptography
Requires:       python2-idna
Requires:       python2-ipaddress
Requires:       python2-pysocks


%description -n python2-%{srcname}
Python2 HTTP module with connection pooling and file POST abilities.

%package -n python27-%{srcname}
Summary:        Python2 HTTP library with thread-safe connection pooling and file post
%{?python_provide:%python_provide python2-%{srcname}}

Requires:       ca-certificates

# Previously bundled things:
Requires:       python27-six
Requires:       python27-backports-ssl_match_hostname

# Secure extra requirements
Requires:       python27-pyOpenSSL
Requires:       python27-cryptography
Requires:       python27-idna
Requires:       python27-ipaddress
Requires:       python27-pysocks

BuildRequires:  python27-devel
BuildRequires:  python27-setuptools
BuildRequires:  python27-six
BuildRequires:  python27-backports-ssl_match_hostname

%description -n python27-%{srcname}
Python2 HTTP module with connection pooling and file POST abilities.

%prep
%setup -q -n %{srcname}-%{version}
# Drop the dummyserver tests in koji.  They fail there in real builds, but not
# in scratch builds (weird).
rm -rf test/with_dummyserver/
# Don't run the Google App Engine tests
rm -rf test/appengine/
# Lots of these tests started failing, even for old versions, so it has something
# to do with Fedora in particular. They don't fail in upstream build infrastructure
rm -rf test/contrib/

%build
%py27_build
%py2_build


%install
%py27_install

# Unbundle the Python 2 build
rm -rf %{buildroot}/%{python27_sitelib}/urllib3/packages/six.py*
rm -rf %{buildroot}/%{python27_sitelib}/urllib3/packages/ssl_match_hostname/

mkdir -p %{buildroot}/%{python27_sitelib}/urllib3/packages/
ln -s ../../six.py %{buildroot}/%{python27_sitelib}/urllib3/packages/six.py
ln -s ../../six.pyc %{buildroot}/%{python27_sitelib}/urllib3/packages/six.pyc
ln -s ../../six.pyo %{buildroot}/%{python27_sitelib}/urllib3/packages/six.pyo

ln -s ../../backports/ssl_match_hostname %{buildroot}/%{python27_sitelib}/urllib3/packages/ssl_match_hostname

%py2_install

# Unbundle the Python 2 build
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py*
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname/

mkdir -p %{buildroot}/%{python2_sitelib}/urllib3/packages/
ln -s ../../six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
ln -s ../../six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
ln -s ../../six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo

ln -s ../../backports/ssl_match_hostname %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname


%files -n python2-%{srcname}
%license LICENSE.txt
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{python2_sitelib}/urllib3/
%{python2_sitelib}/urllib3-*.egg-info

%files -n python27-%{srcname}
%license LICENSE.txt
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{python27_sitelib}/urllib3/
%{python27_sitelib}/urllib3-*.egg-info

%changelog
* Thu Jan 04 2018 Yunfei Shi <shiyf2@lenovo.com>  - 1.22-4
- Append python27 package.

* Tue Jan 02 2018 Yunfei Shi <shiyf2@lenovo.com>  - 1.22-3
- Initial package.