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
This commit is contained in:
Tomáš Chvátal 2019-01-14 08:43:18 +00:00 committed by Git OBS Bridge
parent 972f961d2c
commit 150744017c
2 changed files with 28 additions and 4 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Jan 8 23:55:51 UTC 2019 - Jonathan Brownell <jbrownell@suse.com>
- 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 <mcepl@suse.com>

View File

@ -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}