forked from pool/python-langtable
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:
3
_multibuild
Normal file
3
_multibuild
Normal file
@@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>data</package>
|
||||
</multibuild>
|
||||
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user