Accepting request 1084592 from home:jreidinger:branches:devel:languages:python

- Split python-langtable-data subpackage to hold XML data that
  package use it saves some spaces and allows usage of that XML
  without python dependency

OBS-URL: https://build.opensuse.org/request/show/1084592
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-langtable?expand=0&rev=14
This commit is contained in:
Matej Cepl 2023-05-04 12:54:25 +00:00 committed by Git OBS Bridge
parent f336dec7b6
commit 2d56c9ec77
2 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Apr 27 20:56:49 UTC 2023 - Josef Reidinger <jreidinger@suse.com>
- Split python-langtable-data subpackage to hold XML data that
package use it saves some spaces and allows usage of that XML
without python dependency
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 6 03:52:27 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com> Tue Dec 6 03:52:27 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-langtable # spec file for package python-langtable
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -34,6 +34,7 @@ BuildRequires: %{pythons}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: libxml2-tools BuildRequires: libxml2-tools
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-langtable-data = %{version}
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
@ -44,16 +45,26 @@ example, guess the territory and the keyboard layout if the language
is known or guess the language and keyboard layout if the territory is is known or guess the language and keyboard layout if the territory is
already known. already known.
%package -n python-langtable-data
Summary: XML data to map various locale settingsn and its relations
%description -n python-langtable-data
Provides XML data used by python-langtable. Packaged separately so it is not affected
by more python target versions and also it can be used indenpendently.
%prep %prep
%autosetup -n langtable-%{version} %autosetup -n langtable-%{version}
%build %build
sed -i -e "s,_DATADIR = .*,_DATADIR = '%{python3_sitelib}/langtable'," langtable/langtable.py
%python_build %python_build
%install %install
%python_install %python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
mkdir -p %{buildroot}/%{_datadir}/langtable/data
# here it needs to copy xml as sadly it is done multiple times and we want to get rid of all data from python
# flavors, so all python version can share same xml data
%python_expand mv %{buildroot}%{$python_sitelib}/langtable/data/* %{buildroot}/%{_datadir}/langtable/data
%check %check
(cd langtable; python3 langtable.py) (cd langtable; python3 langtable.py)
@ -69,4 +80,7 @@ done
%doc README ChangeLog %doc README ChangeLog
%{python_sitelib}/* %{python_sitelib}/*
%files -n python-langtable-data
%{_datadir}/langtable
%changelog %changelog