File gumbo-parser.spec of Package gumbo-parser

#
# spec file for package gumbo-parser
#
# Copyright (c) 2023 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/
#

#
# """
# It [gumbo] was in Factory previously.
#
# gumbo development was discontinued. There are "serious problems" ascribed to
# it. The codeberg gumbo-parser fork [as of 2024-09-27] does not address them.
# The nokogiri fork on the other hand is internal to nokogiri.
#
# https://bugzilla.suse.com/show_bug.cgi?id=1208381
#
# I would recommend people to switch away from gumbo and towards libxml2's 
# HTML parser.
# """ --jengelh (private mail archive)

%define lname   libgumbo2
Name:           gumbo-parser
Version:        0.12.1
Release:        0
Summary:        An HTML5 parsing library in pure C99
License:        Apache-2.0
Group:          Development/Libraries/C and C++
URL:            https://codeberg.org/grisha/gumbo-parser
Source:         https://codeberg.org/grisha/gumbo-parser/archive/%version.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkg-config

%description
Gumbo is an implementation of the HTML5 parsing algorithm implemented
as a C99 library. It is fully conformant with the HTML5
specification, robust and resilient to bad input, supports source
locations and pointers back to the original text.

%package -n %lname
Summary:        An HTML5 parsing library
Group:          System/Libraries

%description -n %lname
Gumbo is an implementation of the HTML5 parsing algorithm implemented
as a C99 library. It is fully conformant with the HTML5
specification, robust and resilient to bad input, supports source
locations and pointers back to the original text.

%package devel
Summary:        Development files for HTML5 parser
Group:          Development/Libraries/C and C++
Requires:       %lname = %version
Obsoletes:      libgumbo-devel < %version-%release
Provides:       libgumbo-devel = %version-%release

%description devel
Gumbo is an implementation of the HTML5 parsing algorithm implemented
as a C99 library. It is fully conformant with the HTML5
specification, robust and resilient to bad input, supports source
locations and pointers back to the original text.

This subpackage contains libraries and header files for developing
applications that want to make use of gumbo-parser.

%prep
%autosetup -n gumbo-parser

%build
%define _configure ../configure
mkdir -p m4 obj
autoreconf -fi
pushd obj
%configure --includedir="%_includedir/%name" --disable-static
%make_build
popd

%install
pushd obj
%make_install docdir="%_defaultdocdir/%name"
popd
find %buildroot -type f -name "*.la" -delete -print

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%_libdir/libgumbo.so.2*
%license doc/COPYING

%files devel
%_includedir/%name/
%_libdir/libgumbo.so
%_libdir/pkgconfig/gumbo.pc

%changelog
openSUSE Build Service is sponsored by