SHA256
8
0
forked from pool/libxml2

Accepting request 963492 from home:dimstar:Factory

Resubmit, rebased after branch was broken by update; fix self-cycle causing issues on bootstrap; puthon yupo fixed

OBS-URL: https://build.opensuse.org/request/show/963492
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libxml2?expand=0&rev=169
This commit is contained in:
2022-03-21 14:09:59 +00:00
committed by Git OBS Bridge
parent d7bf846df9
commit 14d165f2cb
3 changed files with 37 additions and 11 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<flavor>python</flavor>
</multibuild>

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Mar 18 09:46:03 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Build python bindings in a 2nd run, using multibuild: otherwise,
libxml2 requires pkgconfig(libxml-2.0) to build, causing issues
to bootstrap.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 8 06:32:13 UTC 2022 - Luciano Santos <luc14n0@opensuse.org> Tue Mar 8 06:32:13 UTC 2022 - Luciano Santos <luc14n0@opensuse.org>

View File

@@ -1,5 +1,5 @@
# #
# spec file for package libxml2 # spec file
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
@@ -18,14 +18,19 @@
%define base_name libxml2 %define base_name libxml2
%define libname libxml2-2 %define libname libxml2-2
%define flavor @BUILD_FLAVOR@%nil
%if "%{flavor}" == "python"
%define dash -
%define buildpython 1
%endif
Name: libxml2 Name: libxml2%{?dash}%{flavor}
Version: 2.9.13 Version: 2.9.13
Release: 0 Release: 0
License: MIT License: MIT
Summary: A Library to Manipulate XML Files Summary: A Library to Manipulate XML Files
URL: https://gitlab.gnome.org/GNOME/libxml2 URL: https://gitlab.gnome.org/GNOME/libxml2
Source0: https://download.gnome.org/sources/%{name}/2.9/%{name}-%{version}.tar.xz Source0: https://download.gnome.org/sources/%{name}/2.9/libxml2-%{version}.tar.xz
Source1: baselibs.conf Source1: baselibs.conf
# #
### -- Upstream patches range from 0 to 999 -- ### ### -- Upstream patches range from 0 to 999 -- ###
@@ -46,18 +51,20 @@ Patch1: libxml2-python3-string-null-check.patch
# PATCH-FIX-SUSE bsc#1135123 Added a new configurable variable XPATH_DEFAULT_MAX_NODESET_LENGTH to avoid nodeset limit # PATCH-FIX-SUSE bsc#1135123 Added a new configurable variable XPATH_DEFAULT_MAX_NODESET_LENGTH to avoid nodeset limit
Patch2000: libxml2-make-XPATH_MAX_NODESET_LENGTH-configurable.patch Patch2000: libxml2-make-XPATH_MAX_NODESET_LENGTH-configurable.patch
# #
BuildRequires: %{python_module devel}
BuildRequires: %{python_module xml}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zlib)
%if 0%{?buildpython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module xml}
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(libxml-2.0)
# TW: generate subpackages for every python3 flavor # TW: generate subpackages for every python3 flavor
%define python_subpackage_only 1 %define python_subpackage_only 1
%python_subpackages %python_subpackages
%endif
%description %description
The XML C library was initially developed for the GNOME project. It is The XML C library was initially developed for the GNOME project. It is
@@ -122,7 +129,7 @@ The XML C library was initially developed for the GNOME project. It is
now used by many programs to load and save extensible data structures now used by many programs to load and save extensible data structures
or manipulate any kind of XML files. or manipulate any kind of XML files.
%package -n python-%{name} %package -n python-libxml2
Summary: Python Bindings for %{name} Summary: Python Bindings for %{name}
Requires: %{libname} = %{version} Requires: %{libname} = %{version}
Requires: python-extras Requires: python-extras
@@ -133,7 +140,7 @@ Provides: python-libxml2-python = %{version}-%{release}
Obsoletes: %{base_name}-python < 2.9.13 Obsoletes: %{base_name}-python < 2.9.13
Obsoletes: python-libxml2-python < 2.9.13 Obsoletes: python-libxml2-python < 2.9.13
%description -n python-%{name} %description -n python-libxml2
This package contains a module that permits This package contains a module that permits
applications written in the Python programming language to use the applications written in the Python programming language to use the
interface supplied by the libxml2 library to manipulate XML files. interface supplied by the libxml2 library to manipulate XML files.
@@ -147,6 +154,7 @@ either at parse time or later once the document has been modified.
%autosetup -p1 -n libxml2-%{version} %autosetup -p1 -n libxml2-%{version}
%build %build
%if ! 0%{?buildpython}
# TODO -- Document why are we using the -fno-strict-aliasing extra flag. # TODO -- Document why are we using the -fno-strict-aliasing extra flag.
export CFLAGS="%{optflags} -fno-strict-aliasing" export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure \ %configure \
@@ -165,11 +173,14 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
--with-http --with-http
%make_build BASE_DIR="%{_docdir}" DOC_MODULE="%{base_name}" %make_build BASE_DIR="%{_docdir}" DOC_MODULE="%{base_name}"
%else
pushd python pushd python
%python_build %python_build
popd popd
%endif
%install %install
%if ! 0%{?buildpython}
%make_install BASE_DIR="%{_docdir}" DOC_MODULE="%{base_name}" %make_install BASE_DIR="%{_docdir}" DOC_MODULE="%{base_name}"
find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p "%{buildroot}/%{_docdir}/%{base_name}" mkdir -p "%{buildroot}/%{_docdir}/%{base_name}"
@@ -178,13 +189,15 @@ ln -s libxml2/libxml %{buildroot}%{_includedir}/libxml
# Remove duplicated file Copyright as not found by fdupes # Remove duplicated file Copyright as not found by fdupes
rm -fr %{buildroot}%{_docdir}/%{base_name}/Copyright rm -fr %{buildroot}%{_docdir}/%{base_name}/Copyright
%fdupes %{buildroot}%{_datadir} %fdupes %{buildroot}%{_datadir}
%else
pushd python pushd python
%python_install %python_install
popd popd
chmod a-x python/tests/*.py chmod a-x python/tests/*.py
%python_expand %fdupes %{buildroot}%{$python_sitearch} %python_expand %fdupes %{buildroot}%{$python_sitearch}
%endif
%if ! 0%{?buildpython}
%check %check
# qemu-arm can't keep up atm, disabling check for arm # qemu-arm can't keep up atm, disabling check for arm
%ifnarch %{arm} %ifnarch %{arm}
@@ -227,12 +240,15 @@ chmod a-x python/tests/*.py
%dir %{_datadir}/gtk-doc %dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html %dir %{_datadir}/gtk-doc/html
%files %{python_files %{name}} %else
%files %{python_files libxml2}
%doc python/TODO %doc python/TODO
%doc python/libxml2class.txt %doc python/libxml2class.txt
%doc doc/*.py %doc doc/*.py
%doc doc/python.html %doc doc/python.html
%pycache_only %{python_sitearch}/__pycache__/*libxml2* %pycache_only %{python_sitearch}/__pycache__/*libxml2*
%{python_sitearch}/*libxml2* %{python_sitearch}/*libxml2*
%endif
%changelog %changelog