15
0

Accepting request 929673 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/929673
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-chardet?expand=0&rev=29
This commit is contained in:
2021-11-06 17:15:44 +00:00
committed by Git OBS Bridge
2 changed files with 22 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 30 08:18:47 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Sun Dec 20 05:52:28 UTC 2020 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-chardet
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,12 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
@@ -34,9 +40,14 @@ URL: https://github.com/chardet/chardet
Source0: https://files.pythonhosted.org/packages/source/c/chardet/chardet-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python-rpm-macros >= 20210929
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module hypothesis}
@@ -95,6 +106,10 @@ mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{$python
%endif
%if !%{with test}
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative chardetect
%post
%python_install_alternative chardetect