File libxslt.spec of Package libxslt.26969

#
# spec file for package libxslt
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           libxslt
%define soname  1
%define exslt_soname 0
Version:        1.1.28
Release:        0
Summary:        XSL Transformation Library
License:        GPL-2.0-or-later AND MIT
Group:          System/Libraries
URL:            http://xmlsoft.org/XSLT/
Source:         ftp://xmlsoft.org/libxslt/libxslt-%{version}.tar.gz
Source2:        baselibs.conf
Source3:        xslt-config.1.gz
Patch0:         %{name}-1.1.24-no-net-autobuild.patch
Patch1:         libxslt-config-fixes.patch
# bsc#1005591
Patch2:         libxslt-CVE-2016-4738.patch
Patch3:         libxslt-random-seed.patch
# PATCH-FIX-UPSTREAM CVE-2017-5029 bsc#1035905
Patch4:         libxslt-1.1.28-CVE-2017-5029.patch
# PATCH-FIX-UPSTREAM CVE-2015-7995 bsc#952474
Patch5:         libxslt-CVE-2015-7995.patch
# PATCH-FIX-UPSTREAM bsc#1132160 CVE-2019-11068 Fix security framework bypass
Patch6:         libxslt-CVE-2019-11068.patch
# PATCH-FIX-UPSTREAM bsc#1140095 CVE-2019-13117 Fix uninitialized read of xsl:number token
Patch7:         libxslt-CVE-2019-13117.patch
# PATCH-FIX-UPSTREAM bsc#1140101 CVE-2019-13118 Fix uninitialized read with UTF-8 grouping chars
Patch8:         libxslt-CVE-2019-13118.patch
# PATCH-FIX-UPSTREAM bsc#1154609 CVE-2019-18197 Fix dangling pointer in xsltCopyText
Patch9:         libxslt-CVE-2019-18197.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libgcrypt-devel
BuildRequires:  libgpg-error-devel
BuildRequires:  libtool
BuildRequires:  libxml2-devel
BuildRequires:  pkg-config
# bug437293
%ifarch ppc64
Obsoletes:      libxslt-64bit
%endif

%description
This C library allows you to transform XML files into other XML files
(or HTML, text, and more) using the standard XSLT stylesheet
transformation mechanism.

It is based on libxml (version 2) for XML parsing, tree manipulation,
and XPath support. It is written in plain C, making as few assumptions
as possible and sticks closely to ANSI C/POSIX for easy embedding.
Although not primarily designed with performance in mind, libxslt seems
to be a relatively fast processor. It also includes full support for
the EXSLT set of extension functions as well as some common extensions
present in other XSLT engines.

%package -n %{name}%{soname}
Summary:        XSL Transformation Library
License:        LGPL-2.1-or-later
Group:          System/Libraries
%if 0%{?suse_version} < 1220
Provides:       %{name}-tools = %{version}
%endif

%description -n %{name}%{soname}
This C library allows you to transform XML files into other XML files
(or HTML, text, and more) using the standard XSLT stylesheet
transformation mechanism.

It is based on libxml (version 2) for XML parsing, tree manipulation,
and XPath support. It is written in plain C, making as few assumptions
as possible and sticks closely to ANSI C/POSIX for easy embedding.
Although not primarily designed with performance in mind, libxslt seems
to be a relatively fast processor. It also includes full support for
the EXSLT set of extension functions as well as some common extensions
present in other XSLT engines.

The package comes with xsltproc, a command line interface to the XSLT
engine.

%package devel
Summary:        Include Files and Libraries mandatory for Development
# bug437293
License:        LGPL-2.1-or-later
Group:          Development/Libraries/C and C++
%ifarch ppc64
Obsoletes:      %{name}-devel-64bit
%endif
%if 0%{?suse_version} >= 1220
Requires:       %{name}-tools = %version
%endif
Requires:       %{name}%{soname} = %{version}
Requires:       glibc-devel
Requires:       libgcrypt-devel
Requires:       libgpg-error-devel
#libxml is automatically required with pkgconfig

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%if 0%{?suse_version} >= 1220
%package tools
Summary:        Extended Stylesheet Language (XSL) Transformation utilities
License:        GPL-2.0-or-later AND MIT
Group:          Development/Tools
Provides:       xsltproc = %version-%release
# O/P added during 12.2 dev:
Obsoletes:      %{name} < %version-%release
Provides:       %{name} = %version-%release

%description tools
This package contains xsltproc, a command line interface to the XSLT engine.
%endif

%prep
%setup -q
%patch0
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1

%build
autoreconf --force --install --verbose
%configure --disable-static --with-pic --without-python --disable-silent-rules
make %{?_smp_mflags}

%check
%if ! 0%{?qemu_user_space_build}
make check
%endif

%install
%makeinstall

# Unwanted doc stuff
rm -fr %{buildroot}%{_datadir}/doc

# the manual page is required
install -ma=r '-t%{buildroot}%{_mandir}/man1' '%{SOURCE3}'

#kill all "la" files
find %{buildroot} -type f -name "*.la" -print -delete

%post -n %{name}%{soname} -p /sbin/ldconfig

%postun -n %{name}%{soname} -p /sbin/ldconfig

%files -n %{name}%{soname}
%defattr(-, root, root)
%{_libdir}/libxslt.so.%{soname}
%{_libdir}/libxslt.so.%{soname}.*
%{_libdir}/libexslt.so.%{exslt_soname}
%{_libdir}/libexslt.so.%{exslt_soname}.*
%if 0%{?suse_version} >= 1220

%files tools
%defattr(-,root,root)
%endif
%license COPYING Copyright
%doc AUTHORS NEWS README TODO FEATURES
%{_bindir}/xsltproc
%doc %{_mandir}/man1/xsltproc.*

%files devel
%defattr(-, root, root)
%{_libdir}/libxslt.so
%{_libdir}/libexslt.so
%{_libdir}/*.sh
%{_libdir}/pkgconfig/libxslt.pc
%{_libdir}/pkgconfig/libexslt.pc
%{_includedir}/*
%{_datadir}/aclocal/*
%{_bindir}/xslt-config
%doc %{_mandir}/man1/xslt-config.*
%doc %{_mandir}/man3/*
# not available doc/*.png
%doc doc/*.html doc/html doc/tutorial doc/*.gif

%changelog
openSUSE Build Service is sponsored by