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