15
0

Accepting request 1089077 from devel:languages:python

- Build data package with multibuild

- 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/1089077
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-langtable?expand=0&rev=8
This commit is contained in:
2023-05-26 18:15:35 +00:00
committed by Git OBS Bridge
3 changed files with 58 additions and 6 deletions

3
_multibuild Normal file
View File

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

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu May 25 06:16:29 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Build data package with multibuild
-------------------------------------------------------------------
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>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-langtable
# spec file
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,8 +16,17 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "data"
%define psuffix -data-src
%bcond_without data
%else
%define psuffix %{nil}
%bcond_with data
%endif
%define skip_python2 1
Name: python-langtable
%global literalpython python
Name: python-langtable%{psuffix}
Version: 0.0.61
Release: 0
Summary: Database to guess defaults for locale settings
@@ -34,6 +43,9 @@ BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: libxml2-tools
BuildRequires: python-rpm-macros
%if %{without data}
Requires: %{literalpython}-langtable-data = %{version}
%endif
BuildArch: noarch
%python_subpackages
@@ -44,16 +56,34 @@ example, guess the territory and the keyboard layout if the language
is known or guess the language and keyboard layout if the territory is
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
%autosetup -n langtable-%{version}
%build
sed -i -e "s,_DATADIR = .*,_DATADIR = '%{python3_sitelib}/langtable'," langtable/langtable.py
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with data}
# Data package
mkdir -p %{buildroot}/%{_datadir}/langtable/data
mv langtable/data/* %{buildroot}/%{_datadir}/langtable/data
%else
# Main package
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand rm -rf %{buildroot}%{$python_sitelib}/langtable/data
%endif
# Main package
%if %{without data}
%check
(cd langtable; python3 langtable.py)
@@ -69,4 +99,11 @@ done
%doc README ChangeLog
%{python_sitelib}/*
%else
# Data package
%files -n python-langtable-data
%{_datadir}/langtable
%endif
%changelog