From d8e18fea0224d3aab411bdebfb452c2f1af74608 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Nov 28 2015 04:22:30 +0000 Subject: Add python3 subpackage --- diff --git a/python-ndg_httpsclient.spec b/python-ndg_httpsclient.spec index f7d9f42..8045b63 100644 --- a/python-ndg_httpsclient.spec +++ b/python-ndg_httpsclient.spec @@ -1,7 +1,7 @@ %global tar_name ndg_httpsclient Name: python-%{tar_name} Version: 0.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Provides enhanced HTTPS support for httplib and urllib2 using PyOpenSSL License: BSD @@ -10,16 +10,12 @@ Source0: https://pypi.python.org/packages/source/n/ndg-httpsclient/%{tar_ BuildArch: noarch BuildRequires: python2-devel -BuildRequires: python-setuptools BuildRequires: pyOpenSSL +BuildRequires: python3-devel +BuildRequires: python3-pyOpenSSL BuildRequires: openssl BuildRequires: /usr/bin/killall - -Requires: pyOpenSSL -Requires: python-pyasn1 -# For the entrypoint -Requires: python-setuptools %description This is a HTTPS client implementation for httplib and urllib2 based on @@ -27,19 +23,47 @@ 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 -%setup -q -n %{tar_name}-%{version} +%autosetup -n %{tar_name}-%{version} # Remove bundled egg-info rm -rf %{tar_name}.egg-info %build -%{__python2} setup.py build +%{py2_build} +%{py3_build} %install -%{__python2} setup.py install --skip-build --root %{buildroot} +%{py3_install} +%{py2_install} %check -cd ndg/httpsclient/test/ +pushd ndg/httpsclient/test/ ./scripts/openssl_https_server.sh & sleep 1 # the test suite is not working and we don't know why @@ -48,15 +72,31 @@ sleep 1 for FILE in test_utils.py; do PYTHONPATH=../../.. %{__python2} ./$FILE done + +for FILE in test_utils.py; do + PYTHONPATH=../../.. %{__python3} ./$FILE +done killall openssl -%files +# 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 +* Sat Nov 28 2015 James Hogarth - 0.4.0-2 +- Add python3 subpackage (#1286321) +- Update to latest python packaging guidelines + * Wed Jul 08 2015 Miro Hrončok - 0.4.0-1 - Update to 0.4.0