SPECS/python-urllib3/python-urllib3.spec
2d879f6b
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
fda4104f
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2d879f6b
 
fda4104f
 Summary:        A powerful, sanity-friendly HTTP client for Python.
 Name:           python-urllib3
 Version:        1.20
a848bcf8
 Release:        3%{?dist}
fda4104f
 Url:            https://pypi.python.org/pypi/urllib3
 License:        MIT
 Group:          Development/Languages/Python
 Vendor:         VMware, Inc.
 Distribution:   Photon
 Source0:        https://github.com/shazow/urllib3/archive/urllib3-1.20.tar.gz
 %define sha1    urllib3=2608f2069d3bb1be36da9483c24aa2a0ada38501
 
 BuildRequires:  python2
 BuildRequires:  python2-libs
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
 
 Requires:       python2
 Requires:       python2-libs
 
 BuildArch:      noarch
 
 %description
 urllib3 is a powerful, sanity-friendly HTTP client for Python. Much of the Python ecosystem already uses urllib3 and you should too.
 
 %package -n     python3-urllib3
 Summary:        python-urllib3
 BuildRequires:  python3
 BuildRequires:  python3-devel
 BuildRequires:  python3-libs
a848bcf8
 BuildRequires:  python3-setuptools
 BuildRequires:  python3-xml
fda4104f
 Requires:       python3
 Requires:       python3-libs
 
 %description -n python3-urllib3
 Python 3 version.
 
 %prep
 %setup -q -n urllib3-%{version}
 
 %build
2d879f6b
 python2 setup.py build
fda4104f
 python3 setup.py build
 
 %install
2d879f6b
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
fda4104f
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 
 %check
2d879f6b
 python2 setup.py test
fda4104f
 python3 setup.py test
 
 %files
 %defattr(-,root,root)
2d879f6b
 %{python2_sitelib}/*
fda4104f
 
 %files -n python3-urllib3
 %defattr(-,root,root,-)
 %{python3_sitelib}/*
 
 %changelog
a848bcf8
 *   Wed Jun 07 2017 Xiaolin Li <xiaolinl@vmware.com> 1.20-3
 -   Add python3-setuptools and python3-xml to python3 sub package Buildrequires.
2d879f6b
 *   Thu Jun 01 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.20-2
 -   Use python2 explicitly
fda4104f
 *   Thu Feb 02 2017 Xiaolin Li <xiaolinl@vmware.com> 1.20-1
 -   Initial packaging for Photon