15
0

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
This commit is contained in:
2023-05-25 11:05:34 +00:00
committed by Git OBS Bridge
parent 2d56c9ec77
commit a033b1fb11
3 changed files with 36 additions and 6 deletions

View File

@@ -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