de84429
%global tar_name ndg_httpsclient
de84429
Name:           python-%{tar_name}
975f93d
Version:        0.4.0
c3bb25f
Release:        3%{?dist}
de84429
Summary:        Provides enhanced HTTPS support for httplib and urllib2 using PyOpenSSL
de84429
de84429
License:        BSD
de84429
URL:            http://ndg-security.ceda.ac.uk/wiki/%{tar_name}/
de84429
Source0:        https://pypi.python.org/packages/source/n/ndg-httpsclient/%{tar_name}-%{version}.tar.gz
de84429
BuildArch:      noarch
de84429
 
de84429
BuildRequires:  python2-devel
de84429
BuildRequires:  pyOpenSSL
d8e18fe
BuildRequires:  python3-devel
d8e18fe
BuildRequires:  python3-pyOpenSSL
de84429
BuildRequires:  openssl
de84429
BuildRequires:  /usr/bin/killall
de84429
de84429
de84429
%description
de84429
This is a HTTPS client implementation for httplib and urllib2 based on
de84429
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
de84429
over the default provided with Python and importantly enables full
de84429
verification of the SSL peer.
de84429
d8e18fe
%package -n python2-ndg_httpsclient
d8e18fe
Requires:       pyOpenSSL
d8e18fe
Requires:       python-pyasn1
d8e18fe
Summary:        %{summary}
d8e18fe
Provides:       python-ndg_httpsclient = %{version}-%{release}
d8e18fe
Obsoletes:      python-ndg_httpsclient <= 0.4.0-1
d8e18fe
%{?python_provide:%python_provide python2-ndg_httpsclient}
d8e18fe
d8e18fe
%description -n python2-ndg_httpsclient
d8e18fe
This is a HTTPS client implementation for httplib and urllib2 based on
d8e18fe
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
d8e18fe
over the default provided with Python and importantly enables full
d8e18fe
verification of the SSL peer. This is the python2 library.
d8e18fe
d8e18fe
%package -n python3-ndg_httpsclient
d8e18fe
Requires:       python3-pyOpenSSL
d8e18fe
Requires:       python3-pyasn1
d8e18fe
Summary:        %{summary}
d8e18fe
%{?python_provide:%python_provide python3-ndg_httpsclient}
d8e18fe
d8e18fe
%description -n python3-ndg_httpsclient
d8e18fe
This is a HTTPS client implementation for httplib and urllib2 based on
d8e18fe
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
d8e18fe
over the default provided with Python and importantly enables full
d8e18fe
verification of the SSL peer. This is the python3 library.
d8e18fe
de84429
%prep
d8e18fe
%autosetup -n %{tar_name}-%{version}
de84429
# Remove bundled egg-info
de84429
rm -rf %{tar_name}.egg-info
de84429
de84429
%build
d8e18fe
%{py2_build}
d8e18fe
%{py3_build}
de84429
de84429
%install
d8e18fe
%{py3_install}
d8e18fe
%{py2_install}
de84429
de84429
%check
d8e18fe
pushd ndg/httpsclient/test/
de84429
./scripts/openssl_https_server.sh &
de84429
sleep 1
de84429
# the test suite is not working and we don't know why
de84429
# upstream bugtracker is not functional
de84429
#for FILE in test_*.py; do
de84429
for FILE in test_utils.py; do
de84429
  PYTHONPATH=../../.. %{__python2} ./$FILE
de84429
done
d8e18fe
d8e18fe
for FILE in test_utils.py; do
d8e18fe
  PYTHONPATH=../../.. %{__python3} ./$FILE
d8e18fe
done
de84429
killall openssl
de84429
d8e18fe
# Make sure the script uses the expected python version
d8e18fe
grep -q %{__python2} %{buildroot}%{_bindir}/ndg_httpclient
d8e18fe
d8e18fe
%files -n python2-ndg_httpsclient
de84429
%{_bindir}/ndg_httpclient
de84429
%{python2_sitelib}/ndg
de84429
%{python2_sitelib}/%{tar_name}-%{version}-py?.?.egg-info
de84429
%{python2_sitelib}/%{tar_name}-%{version}-py?.?-nspkg.pth
de84429
d8e18fe
%files -n python3-ndg_httpsclient
d8e18fe
%{python3_sitelib}/ndg
d8e18fe
%{python3_sitelib}/%{tar_name}-%{version}-py?.?.egg-info
d8e18fe
%{python3_sitelib}/%{tar_name}-%{version}-py?.?-nspkg.pth
d8e18fe
de84429
%changelog
c3bb25f
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
c3bb25f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c3bb25f
d8e18fe
* Sat Nov 28 2015 James Hogarth <james.hogarth@gmail.com> - 0.4.0-2
d8e18fe
- Add python3 subpackage (#1286321)
d8e18fe
- Update to latest python packaging guidelines
d8e18fe
975f93d
* Wed Jul 08 2015 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-1
975f93d
- Update to 0.4.0
975f93d
71822e0
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
71822e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
71822e0
de84429
* Tue Oct 14 2014 Miro Hrončok <mhroncok@redhat.com> - 0.3.2-1
de84429
- Initial package.