From 150744017c0f39deef58e88c9be6512f534027c44d372f1b927094d149a36105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 14 Jan 2019 08:43:18 +0000 Subject: [PATCH] Accepting request 664463 from home:jbrownell:branches:devel:languages:python - Limit SUSE certificate patch to exclude Red Hat platforms since the relevant /etc/ssl/ca-bundle.pem does not exist there - %py_compile and %py3_compile macros do not exist on Red Hat; substitute them with equivalent %python_exec invocations OBS-URL: https://build.opensuse.org/request/show/664463 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-certifi?expand=0&rev=32 --- python-certifi.changes | 9 +++++++++ python-certifi.spec | 23 +++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/python-certifi.changes b/python-certifi.changes index d5e0b31..f1fb7a7 100644 --- a/python-certifi.changes +++ b/python-certifi.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 8 23:55:51 UTC 2019 - Jonathan Brownell + +- Limit SUSE certificate patch to exclude Red Hat platforms since + the relevant /etc/ssl/ca-bundle.pem does not exist there + +- %py_compile and %py3_compile macros do not exist on Red Hat; + substitute them with equivalent %python_exec invocations + ------------------------------------------------------------------- Tue Dec 4 12:46:35 UTC 2018 - Matej Cepl diff --git a/python-certifi.spec b/python-certifi.spec index e0ebfd3..981eef0 100644 --- a/python-certifi.spec +++ b/python-certifi.spec @@ -1,7 +1,7 @@ # # spec file for package python-certifi # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -23,9 +23,9 @@ Release: 0 Summary: Python package for providing Mozilla's CA Bundle License: MPL-2.0 Group: Development/Languages/Python -URL: https://pypi.python.org/pypi/certifi +Url: https://pypi.python.org/pypi/certifi Source: https://files.pythonhosted.org/packages/source/c/certifi/certifi-%{version}.tar.gz -# PATCH-FIX-SUSE -- prefer SUSE certificates +# PATCH-FIX-SUSE -- prefer SUSE certificates (only for use on SUSE platforms) Patch0: python-certifi-shipped-requests-cabundle.patch BuildRequires: %{python_module setuptools} BuildRequires: ca-certificates @@ -45,7 +45,9 @@ derived from Mozilla Firefox's canonical set. %prep %setup -q -n certifi-%{version} +%if 0%{?suse_version} %patch0 -p1 +%endif %build %python_build @@ -55,9 +57,21 @@ derived from Mozilla Firefox's canonical set. %{python_expand chmod +x %{buildroot}%{$python_sitelib}/certifi/core.py sed -i "s|#!%{_bindir}/env python|#!%__$python|" %{buildroot}/%{$python_sitelib}/certifi/core.py + %if 0%{?suse_version} rm %{buildroot}%{$python_sitelib}/certifi/cacert.pem + %endif } +%if 0%{?rhel} || 0%{?fedora} +%if 0%{?have_python2} +%python_exec -m compileall %{buildroot}%{python2_sitelib}/certifi/ +%python_exec -O -m compileall %{buildroot}%{python2_sitelib}/certifi/ +%endif +%if 0%{?have_python3} +%python_exec -m compileall %{buildroot}%{python3_sitelib}/certifi/ +%python_exec -O -m compileall %{buildroot}%{python3_sitelib}/certifi/ +%endif +%else %if 0%{?have_python2} %py_compile %{buildroot}%{python2_sitelib}/certifi/ %py_compile -O %{buildroot}%{python2_sitelib}/certifi/ @@ -66,6 +80,7 @@ derived from Mozilla Firefox's canonical set. %py3_compile %{buildroot}%{python3_sitelib}/certifi/ %py3_compile -O %{buildroot}%{python3_sitelib}/certifi/ %endif +%endif %python_expand %fdupes %{buildroot}%{$python_sitelib}