From 2d56c9ec771f993611b1df05d7e66953b25977de6a40cf81bd77be7cb7297230 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 4 May 2023 12:54:25 +0000 Subject: [PATCH 1/5] 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 --- python-langtable.changes | 7 +++++++ python-langtable.spec | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/python-langtable.changes b/python-langtable.changes index fc74932..c1504ea 100644 --- a/python-langtable.changes +++ b/python-langtable.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 27 20:56:49 UTC 2023 - Josef Reidinger + +- 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 diff --git a/python-langtable.spec b/python-langtable.spec index fbb1a5c..5fa07b2 100644 --- a/python-langtable.spec +++ b/python-langtable.spec @@ -1,7 +1,7 @@ # # 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 # remain the property of their copyright owners, unless otherwise agreed @@ -34,6 +34,7 @@ BuildRequires: %{pythons} BuildRequires: fdupes BuildRequires: libxml2-tools BuildRequires: python-rpm-macros +Requires: python-langtable-data = %{version} BuildArch: noarch %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 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} +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 (cd langtable; python3 langtable.py) @@ -69,4 +80,7 @@ done %doc README ChangeLog %{python_sitelib}/* +%files -n python-langtable-data +%{_datadir}/langtable + %changelog From a033b1fb115f118fe6c6f27d571a85153f8617e04c2e447176e4e266fe5d9455 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 25 May 2023 11:05:34 +0000 Subject: [PATCH 2/5] Accepting request 1088953 from home:dgarcia:branches:devel:languages:python - Build data package with multibuild OBS-URL: https://build.opensuse.org/request/show/1088953 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-langtable?expand=0&rev=15 --- _multibuild | 3 +++ python-langtable.changes | 5 +++++ python-langtable.spec | 34 ++++++++++++++++++++++++++++------ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..566de21 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + data + diff --git a/python-langtable.changes b/python-langtable.changes index c1504ea..0be7fad 100644 --- a/python-langtable.changes +++ b/python-langtable.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 25 06:16:29 UTC 2023 - Daniel Garcia + +- Build data package with multibuild + ------------------------------------------------------------------- Thu Apr 27 20:56:49 UTC 2023 - Josef Reidinger diff --git a/python-langtable.spec b/python-langtable.spec index 5fa07b2..5bb0807 100644 --- a/python-langtable.spec +++ b/python-langtable.spec @@ -16,6 +16,14 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "data" +%define psuffix -data +%bcond_without data +%else +%define psuffix %{nil} +%bcond_with data +%endif %define skip_python2 1 Name: python-langtable Version: 0.0.61 @@ -34,7 +42,9 @@ BuildRequires: %{pythons} BuildRequires: fdupes BuildRequires: libxml2-tools BuildRequires: python-rpm-macros +%if %{without data} Requires: python-langtable-data = %{version} +%endif BuildArch: noarch %python_subpackages @@ -59,12 +69,20 @@ by more python target versions and also it can be used indenpendently. %python_build %install -%python_install -%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 + +%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) @@ -80,7 +98,11 @@ done %doc README ChangeLog %{python_sitelib}/* +%else +# Data pacakge + %files -n python-langtable-data %{_datadir}/langtable +%endif %changelog From 7e9447aaacff517e99499e016cc6f7ea0290aa9432f2fe0900eebdab0a7542c8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 25 May 2023 11:06:23 +0000 Subject: [PATCH 3/5] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-langtable?expand=0&rev=16 --- python-langtable.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-langtable.spec b/python-langtable.spec index 5bb0807..33ea41d 100644 --- a/python-langtable.spec +++ b/python-langtable.spec @@ -1,5 +1,5 @@ # -# spec file for package python-langtable +# spec file # # Copyright (c) 2023 SUSE LLC # @@ -25,7 +25,7 @@ %bcond_with data %endif %define skip_python2 1 -Name: python-langtable +Name: python-langtable%{psuffix} Version: 0.0.61 Release: 0 Summary: Database to guess defaults for locale settings @@ -99,7 +99,7 @@ done %{python_sitelib}/* %else -# Data pacakge +# Data package %files -n python-langtable-data %{_datadir}/langtable From 2e51b54a1586babfdf1712506869c85cb9478555a3d13551aa4d06e94381a5b3 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 25 May 2023 11:10:23 +0000 Subject: [PATCH 4/5] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-langtable?expand=0&rev=17 --- python-langtable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-langtable.spec b/python-langtable.spec index 33ea41d..37d442e 100644 --- a/python-langtable.spec +++ b/python-langtable.spec @@ -18,7 +18,7 @@ %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "data" -%define psuffix -data +%define psuffix -data-src %bcond_without data %else %define psuffix %{nil} From 52c4bf3d5f13cbccc870d84479730e44b1999dfe8b3372b4cfc66ce1ee55839a Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 26 May 2023 05:55:27 +0000 Subject: [PATCH 5/5] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-langtable?expand=0&rev=18 --- python-langtable.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-langtable.spec b/python-langtable.spec index 37d442e..d25fffa 100644 --- a/python-langtable.spec +++ b/python-langtable.spec @@ -25,6 +25,7 @@ %bcond_with data %endif %define skip_python2 1 +%global literalpython python Name: python-langtable%{psuffix} Version: 0.0.61 Release: 0 @@ -43,7 +44,7 @@ BuildRequires: fdupes BuildRequires: libxml2-tools BuildRequires: python-rpm-macros %if %{without data} -Requires: python-langtable-data = %{version} +Requires: %{literalpython}-langtable-data = %{version} %endif BuildArch: noarch %python_subpackages