Blob Blame History Raw
%global tar_name ndg_httpsclient
Name:           python-%{tar_name}
Version:        0.4.0
Release:        3%{?dist}
Summary:        Provides enhanced HTTPS support for httplib and urllib2 using PyOpenSSL

License:        BSD
URL:            http://ndg-security.ceda.ac.uk/wiki/%{tar_name}/
Source0:        https://pypi.python.org/packages/source/n/ndg-httpsclient/%{tar_name}-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python2-devel
BuildRequires:  pyOpenSSL
BuildRequires:  python3-devel
BuildRequires:  python3-pyOpenSSL
BuildRequires:  openssl
BuildRequires:  /usr/bin/killall


%description
This is a HTTPS client implementation for httplib and urllib2 based on
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
over the default provided with Python and importantly enables full
verification of the SSL peer.

%package -n python2-ndg_httpsclient
Requires:       pyOpenSSL
Requires:       python-pyasn1
Summary:        %{summary}
Provides:       python-ndg_httpsclient = %{version}-%{release}
Obsoletes:      python-ndg_httpsclient <= 0.4.0-1
%{?python_provide:%python_provide python2-ndg_httpsclient}

%description -n python2-ndg_httpsclient
This is a HTTPS client implementation for httplib and urllib2 based on
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
over the default provided with Python and importantly enables full
verification of the SSL peer. This is the python2 library.

%package -n python3-ndg_httpsclient
Requires:       python3-pyOpenSSL
Requires:       python3-pyasn1
Summary:        %{summary}
%{?python_provide:%python_provide python3-ndg_httpsclient}

%description -n python3-ndg_httpsclient
This is a HTTPS client implementation for httplib and urllib2 based on
PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation
over the default provided with Python and importantly enables full
verification of the SSL peer. This is the python3 library.

%prep
%autosetup -n %{tar_name}-%{version}
# Remove bundled egg-info
rm -rf %{tar_name}.egg-info

%build
%{py2_build}
%{py3_build}

%install
%{py3_install}
%{py2_install}

%check
pushd ndg/httpsclient/test/
./scripts/openssl_https_server.sh &
sleep 1
# the test suite is not working and we don't know why
# upstream bugtracker is not functional
#for FILE in test_*.py; do
for FILE in test_utils.py; do
  PYTHONPATH=../../.. %{__python2} ./$FILE
done

for FILE in test_utils.py; do
  PYTHONPATH=../../.. %{__python3} ./$FILE
done
killall openssl

# Make sure the script uses the expected python version
grep -q %{__python2} %{buildroot}%{_bindir}/ndg_httpclient

%files -n python2-ndg_httpsclient
%{_bindir}/ndg_httpclient
%{python2_sitelib}/ndg
%{python2_sitelib}/%{tar_name}-%{version}-py?.?.egg-info
%{python2_sitelib}/%{tar_name}-%{version}-py?.?-nspkg.pth

%files -n python3-ndg_httpsclient
%{python3_sitelib}/ndg
%{python3_sitelib}/%{tar_name}-%{version}-py?.?.egg-info
%{python3_sitelib}/%{tar_name}-%{version}-py?.?-nspkg.pth

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Nov 28 2015 James Hogarth <james.hogarth@gmail.com> - 0.4.0-2
- Add python3 subpackage (#1286321)
- Update to latest python packaging guidelines

* Wed Jul 08 2015 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-1
- Update to 0.4.0

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Tue Oct 14 2014 Miro Hrončok <mhroncok@redhat.com> - 0.3.2-1
- Initial package.