From 149fc2513c86ac772fb6ddc6f48ffb8dc4a0708ffa2dd2d226af276cf9e84b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 25 May 2020 09:30:34 +0000 Subject: [PATCH] Accepting request 808630 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/808630 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-language-check?expand=0&rev=6 --- python-language-check.changes | 5 +++++ python-language-check.spec | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/python-language-check.changes b/python-language-check.changes index 612fe45..dda8057 100644 --- a/python-language-check.changes +++ b/python-language-check.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 25 06:50:33 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Wed Dec 19 00:30:24 UTC 2018 - Jan Engelhardt diff --git a/python-language-check.spec b/python-language-check.spec index 8084a3d..30f287c 100644 --- a/python-language-check.spec +++ b/python-language-check.spec @@ -1,7 +1,7 @@ # # spec file for package python-language-check # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,23 +16,22 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +%define ltver 3.2 # Tests try to access the network on other architectures for some reason %ifarch x86_64 %{ix86} %bcond_without test %else %bcond_with test %endif - -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 Name: python-language-check Version: 1.1 Release: 0 -%define ltver 3.2 Summary: Python wrapper for checking grammar with LanguageTool License: LGPL-3.0-or-later Group: Development/Languages/Python -Url: https://github.com/myint/language-check +URL: https://github.com/myint/language-check Source: https://files.pythonhosted.org/packages/source/l/language-check/language-check-%{version}.tar.gz Source1: https://www.languagetool.org/download/LanguageTool-%{ltver}.zip BuildRequires: %{python_module setuptools} @@ -41,8 +40,9 @@ BuildRequires: java = 1.8.0 BuildRequires: python-rpm-macros BuildRequires: unzip Requires: java = 1.8.0 +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch - %python_subpackages %description @@ -71,6 +71,7 @@ chmod a-x language_check/LanguageTool-%{ltver}/org/languagetool/resource/ru/make %install %python_install +%python_clone -a %{buildroot}%{_bindir}/language-check %python_expand %fdupes %{buildroot}%{$python_sitelib} %if %{with test} @@ -79,11 +80,16 @@ export LANG=en_US.UTF-8 %python_exec setup.py test %endif +%post +%python_install_alternative language-check + +%postun +%python_uninstall_alternative language-check + %files %{python_files} -%defattr(-,root,root,-) %doc README.rst %license COPYING COPYING.LESSER -%python3_only %{_bindir}/language-check +%python_alternative %{_bindir}/language-check %{python_sitelib}/* %changelog