15
0

Accepting request 679159 from devel:languages:python

- Switch to multibuild to avoid buildcycles

OBS-URL: https://build.opensuse.org/request/show/679159
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-chardet?expand=0&rev=25
This commit is contained in:
2019-02-26 21:16:05 +00:00
committed by Git OBS Bridge
3 changed files with 28 additions and 6 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 26 08:14:25 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Switch to multibuild to avoid buildcycles
-------------------------------------------------------------------
Tue Dec 4 12:49:12 UTC 2018 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-chardet
#
# 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
@@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-chardet
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-chardet%{psuffix}
Version: 3.0.4
Release: 0
Summary: Universal encoding detector
@@ -26,14 +34,16 @@ Group: Development/Languages/Python
URL: https://github.com/chardet/chardet
Source0: https://files.pythonhosted.org/packages/source/c/chardet/chardet-%{version}.tar.gz
Source1: python-chardet-rpmlintrc
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest-runner}
%endif
%python_subpackages
%description
@@ -72,17 +82,20 @@ or more files::
%python_build
%install
%python_install
%if !%{with test}
%{python_expand %$python_install
mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{$python_bin_suffix}
%fdupes -s %{buildroot}%{$python_sitelib}
}
%prepare_alternative chardetect
%endif
%check
%if %{with test}
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} test.py
%endif
%if !%{with test}
%post
%python_install_alternative chardetect
@@ -94,5 +107,6 @@ mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{$python
%python_alternative %{_bindir}/chardetect
%{python_sitelib}/chardet
%{python_sitelib}/chardet-%{version}-py%{python_version}.egg-info
%endif
%changelog