#
# spec file for package libxml++30
#
# Copyright (c) 2024 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/
#


%define _name   libxml++
# Bump the version in baselibs too!
%define so_ver  3_0-1

Name:           libxml++30
Version:        3.2.5
Release:        1.4
Summary:        C++ Interface for XML Files
License:        LGPL-2.1-or-later
Group:          Development/Libraries/C and C++
URL:            https://libxmlplusplus.github.io/libxmlplusplus
Source0:        https://download.gnome.org/sources/libxml++/3.2/%{_name}-%{version}.tar.xz
Source1:        baselibs.conf

BuildRequires:  c++_compiler
BuildRequires:  fdupes
BuildRequires:  meson >= 0.55.0
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(glibmm-2.4) >= 2.32.0
BuildRequires:  pkgconfig(libxml-2.0) >= 2.7.7

%description
libXML++ provides a C++ interface for XML files. It presently uses
libxml2 to access the XML files.

%package -n libxml++-%{so_ver}
Summary:        C++ Interface for XML Files
Group:          Development/Libraries/C and C++
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description -n libxml++-%{so_ver}
libXML++ provides a C++ interface for XML files. It presently uses
libxml2 to access the XML files.

%package devel
Summary:        C++ Interface for XML Files -- Development Files
Group:          Development/Libraries/C and C++
Requires:       glibmm2-devel
Requires:       libxml++-%{so_ver} = %{version}

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

%prep
%autosetup -p1 -n %{_name}-%{version}
chmod -x NEWS libxml++config.h.in libxml++config.h.meson

%build
%meson \
	%{nil}
%meson_build

%install
%meson_install
%fdupes %{buildroot}%{_prefix}

%ldconfig_scriptlets -n libxml++-%{so_ver}

%check
%meson_test

%files -n libxml++-%{so_ver}
%license COPYING
%doc ChangeLog NEWS README.md
%{_libdir}/*.so.*

%files devel
%{_includedir}/libxml++-3.0
%dir %{_libdir}/libxml++-3.0
%dir %{_libdir}/libxml++-3.0/include
%{_libdir}/libxml++-3.0/include/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so

%changelog
* Mon Aug 12 2024 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 3.2.5:
  + Documentation:
  - Update Visual Studio build docs
  - Parser docs: Add a link to parser options
  + Meson build:
  - Detect if we build from a git subtree
  - Don't copy files with configure_file()
  - Fix the evaluation of is_git_build on Windows
  - Backport libxml2 CMake support from libxml++-5.0
  - Don't fail if warning_level=everything
  - Don't require the 'dot' command to build the documentation
  - Add the build-manual option
  - Add bcrypt dependency when libxml2 is a subproject
  + Build: Make it compatible with libxml2 >= 2.12.0 by modifying
    [#]include directives
- Add check section and run meson_test macro.
* Sun Sep 11 2022 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 3.2.4:
  + Document, Node: Recognize HTML documents
  + Parsers: Avoid std::getline for istream inputs
  + Build:
  - Meson build:
    . When mm-common >= 1.0.4 is used, Perl is not required
    . Require meson >= 0.55.0
    . Specify 'check' option in run_command(). Will be necessary
    with future versions of Meson.
    . Avoid configuration warnings
  - Win32: Don't include afxres.h in resources.
  - Support Visual Studio 2022
  - docs/manual: Sort example file lists. See
    glgo/GNOME/gtkmm-documentation/!15
  - NMake Makefiles: Make things more configurable.
  + Documentation:
  - docs/manual: Upgrade from DocBook 4.1 to DocBook 5.0
  - MSVC_NMake/README: Document dependency placement
- Changes from version 3.2.3:
  + Build:
  - libxml++config.h.*: Don't dllimport on MinGW
  - Meson build:
    . Make it possible to use libxml++ as a subproject
    . No implicit_include_directories
  - MSVC build: Export classes selectively
  + Documentation: Let links point to libxml++-3.0 versions instead
    of latest versions.
- Drop erroneous executable bit from docs and headerfiles.
- Use ldconfig_scriptlets macro for post(un) handling.
* Mon Dec 28 2020 Bjørn Lie <bjorn.lie@gmail.com>
- Add define so_ver, make future so bumps easier.
* Mon Dec 21 2020 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 3.2.2:
  + Build:
  - Add NMake Makefiles. Remove Visual Studio 2010 projects.
  - Add support for building with Meson.
  - Use __declspec(dllexport) when building on Visual Studio.
    Stop using gendef.exe.
- Add meson BuildRequires and macros.
- Replace gcc-c++ with generic c++_compiler BuildRequires.
- Update URL to new home.
* Thu Apr  2 2020 Bjørn Lie <bjorn.lie@gmail.com>
- Rename package to libxml++30. Allow for libxml++ to move to new
  branches released by upstream.
* Sat Jan 11 2020 Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 3.2.0:
  + Document, DomParser: Improve XInclude processing:
  - Document: Add process_xinclude() overload that takes a
    fixup_base_uris parameter.
  - DomParser: Add set/get_xinclude_options() and add optional
    XInclude processing to the parse methods (bgo#781566).
  + Add explicit keyword to some single-parameter constructors.
  + tests: Don't require C++17.
  + Build: Fix srcdir != buildir build.
- Modernize spec.
* Wed Feb 28 2018 dimstar@opensuse.org
- Modernize spec-file by calling spec-cleaner
* Mon Nov 14 2016 dimstar@opensuse.org
- Update to version 3.0.1 (jsc#SLE-8163, FATE#324347):
  + Element::remove_attribute(): Delete the C++ wrapper
    (bgo#768404).
* Tue Feb  2 2016 dimstar@opensuse.org
- Update to version 3.0.0:
  + This release is identical to the unstable 2.91.3, except for
    the so name, which has now been bumped (bgo#760574).
- Rename libxml++-3_0-0 subpackage to libxml++-3_0-1, following
  upstreams soname bump (also in baselibs.conf).
* Tue Jan 12 2016 zaitor@opensuse.org
- Update to version 2.91.3:
  + Element: Remove a redundant nullptr check (bgo#757515).
  + Use scoped enums (enum class) instead of unscoped enums.
  + Document: Test for nullptr in a constructor.
  + DomParser: Make operator bool() explicit.
  + The ABI and API are not identical to libxml++ 2.91.2.
* Fri Nov 27 2015 zaitor@opensuse.org
- Update to version 2.91.2:
  + Remove the preprocessor constant LIBXMLCPP_EXCEPTIONS_ENABLED.
    It was always 1.
  + Add a config-time test for support of std::exception_ptr. Don't
    try to use std::exception_ptr on a system where it does not
    exist. This includes re-implementing the wrapped_exception
    class and the raise() and clone() methods in xmlpp::exception
    and its subclasses (bgo##757042).
  + The ABI is not identical to that of libxml++ 2.91.1. There may
    be more changes in ABI and/or API before the first stable
    libxml++-3.0 release.
- Changes from version 2.91.1:
  + Renamed ABI from libxml++-2.6 to libxml++-3.0.
  + This requires applications to change their pkg-config check to
    libxml++-3.0 when they wish to use libxml++ 2.9x or 3.x instead
    of libxml++2.x. (bgo#754673).
  + There may be more changes in ABI and/or API before the first
    stable libxml++-3.0 release.
  + Node: Add const_NodeList and use it in a const version of
    get_children().
  + Add const_NodeSet and use it in a const version of find().
  + Replace xmlpp::NodeSet by xmlpp::Node::NodeSet.
  + Element: Add const_Attribute_list and use it in a const
    version of get_attributes() (bgo#338907).
  + Document: Add a non-const version of get_root_node(). Let the
    const version return a const pointer (bgo#632522).
  + Element: Add a non-const version of get_attribute(). Let the
    const version return a const pointer (bgo#632524).
  + Replace the deprecated std::auto_ptr by std::unique_ptr
    (bgo#753123).
  + DomParser: The default behaviour is to throw both parse errors
    and validity errors in an exception instead of printing some
    messages on stderr.
  + Parser: Some protected data has become private.
  + Several classes: Some virtual methods have become non-virtual,
    and some non-virtual methods have become virtual.
  + Remove class xmlpp::wrapped_exception and the deprecated
    classes Schema and SchemaValidator.
  + xmlpp::exception and its subclasses: Remove Raise() and
    Clone().
  + SaxParser: Start each parsing with a new Document for entity
    resolution.
  + Move all Node::add_child*() methods to Element and rename them
    to add_child_element*().
  + Attribute: Move set_value() to AttributeNode.
  + Use std::string instead of Glib::ustring for filenames.
  + Node: Replace remove_child() by remove_node().
  + Move some code from DtdValidator to Dtd.
  + Element: Rename set/get_child_text() to
    set/get_first_child_text().
  + Rename subpackages following upstreams soname bump.
  + Bump version in baselibs.conf.
* Wed Sep 30 2015 zaitor@opensuse.org
- Update to version 2.40.0:
  + Build improvements.
* Sat Sep  5 2015 zaitor@opensuse.org
- Update to version 2.39.2:
  + SaxParser: Fix “double free or corruption” if a std::exception
    is thrown by a handler method.
  + Replace some (deprecated in C++11) std::auto_ptr by
    std::unique_ptr. There are still some auto_ptrs in header files
    bug replacing them would break ABI (bgo#753123).
* Sat Jul 25 2015 zaitor@opensuse.org
- Update to version 2.39.1:
  + Use (and require) C++11.
* Thu Jul 23 2015 zaitor@opensuse.org
- Run spec-cleaner, make spec more modern.
- Replace glibmm2-devel and libxml2-devel for their pkgconfig()
  equivalents.
* Mon Jun  8 2015 zaitor@opensuse.org
- Update to version 2.38.1:
  + Fix the build with C++11 compilers, such as MS Visual C++ 2013.
    Implicit conversions from streams to bool are no longer
    allowed.
  + Build:
  - Disable deprecated API in dependencies if
  - -enable-warnings=fatal.
  - Require libxml2 2.7.7 or later.
* Fri Feb 27 2015 zaitor@opensuse.org
- Update to version 2.38.0:
  + No changes from last relase, stable version bump only.
* Wed Jan 28 2015 zaitor@opensuse.org
- Update to version 2.37.2:
  + Add version information to libxml++config.h.
  + Document: Avoid possible null pointer dereference (bgo#732604).
  + Element::set_namespace_declaration(): Update the node's
    associated namespace. Add dom_update_namespace example program
    (bgo#737682).
  + Add Node::add_child_with_new_ns() (bgo#737682).
  + Schema: Don't use null pointers in get_name(),
    get_target_namespace() and get_version().
  + Add XsdSchema and XsdValidator. Deprecate Schema and
    SchemaValidator.
  + Add RelaxNGSchema and RelaxNGValidator (bgo#737712).
  + Parser: Add input operator>>(std::istream& in, Parser& parser)
    (bgo#329281).
  + Documentation: Use doxygen-extra.css from the mm-common
    package. Requires mm-common 0.9.7 when configured to use
    maintainer-mode.
  + Build: Avoid infinite loop with Doxygen 1.8.6.
* Mon Aug 18 2014 fcrozat@suse.com
- Add obsoletes/provides to baselibs.conf.
* Mon Sep 16 2013 dimstar@opensuse.org
- Update to version 2.37.1:
  + Parser: Add [set|get]_include_default_attributes()
    (bgo#701674).
  + Improve some null-pointer checks (bgo#705187).
  + Build fixes (bgo#678390, bgo#702136).
  + Updated documentation.
* Mon Nov  5 2012 dimstar@opensuse.org
- Update to version 2.36.0:
  + Element::set_namespace_declaration(): It is not an error to set
    the same URI twice (bgo#635846).
  + Require libxml-2.0 >= 2.7.3.
  + Parser::initialize_context(): Call xmlCtxtUseOptions().
* Wed Oct 10 2012 dimstar@opensuse.org
- Update to version 2.35.4:
  + Document:
  - Add process_xinclude(), using new XIncludeStart and
    XIncludeEnd classes, derived from Node. (bgo#338521)
  - Make the Document(xmlDoc*) constructor public. (bgo#668980)
  + Parser: Make it thread-safe. (bgo#681467)
  + Schema::set_document(): If the argument 'document' is 0 then
    create an empty document, as the documentation says.
  + Improve the error handling. (bgo#635846)
  + Updated documentation.
* Thu Jun 21 2012 dimstar@opensuse.org
- Update to version 2.35.3:
  + Note:
  - Add eval_to_[boolean|number|string]() methods. (bgo#316244)
  - Fix memory problems in import_node(). (bgo#672992)
  + Build:
  - The examples are now built and run during make check.
    (bgo#678390)
  - Define LIBXMLCPP_EXCEPTIONS_ENABLED unconditionally.
* Thu Mar 22 2012 vuntz@opensuse.org
- Update to version 2.35.2:
  + Node: Add get_first_child() (bgo#648125).
  + Build: Remove the --disable-api-exceptions configure option.
* Thu Feb 16 2012 dimstar@opensuse.org
- Update to version 2.35.1:
  + Handle attributes with default values correctly (bgo#669635)
  + Improved handling of entity references and processing
    instructions (bgo#669481)
  + Parser: Throw more detailed error messages (bgo#304020)
  + Document: Make the Document(xmlDoc*) constructor protected.
    (bgo#668980)
* Tue Sep  6 2011 vuntz@opensuse.org
- Update to version 2.34.2:
  + Element: Add add_child_cdata(), like the existing
    add_child_text().
  + Node::create_new_child_node(): Use the default namespace if
    none is specified (bgo#656110).
  + Documentation: Fix a markup typo.
* Tue Apr 26 2011 vuntz@opensuse.org
- Update to version 2.34.1:
  + Do not require mm-common during the tarball build.
- Changes from version 2.34.0:
  + Build fix.
- Changes from version 2.33.1:
  + Node::remove_child(): Fix a memory management problem
    introduced in 2.33.1.
  + Document::do_write_to_stream(), Schema::set_document(): Check
    the results from xmlSchemaNewDocParserCtxt() and
    xmlSaveFormatFileTo() (bgo#635846)
- Changes from version 2.33.1:
  + (Hopefully) allow separate and multi-threaded libxml2 usage by
    not using the global xmlRegisterNodeDefault() and
    xmlDeregisterNodeDefault() callbacks.
  + Do not call xmlCleanupParser() when the library is unloaded,
    because it is brutal and can break other parts of applications
    that try to use libxml separately.
  + Minor code improvement.
  + Build: Build the examples by default.
* Fri Oct 15 2010 vuntz@opensuse.org
- Update to version 2.32.0:
  + Node::find(): Check xmlNode::type for a XML_NAMESPACE_DECL to
    prevent a crash/corruption (bgo#386013)
  + Build: Added an MSVC .net 2010 and 64-bit Windows builds.
* Thu Oct 14 2010 coolo@novell.com
- add baselibs.conf to build 32bit libs needed for libffado2-32bit
* Thu May  6 2010 dimstar@opensuse.org
- Update to version 2.30.1:
  + Documentation fixes.
- Drop libxml++-2.24.0-pkgconfig-requires-private.patch.
* Tue Mar 30 2010 vuntz@opensuse.org
- Update to version 2.30.0:
  + Build system rewrite.
  + Use mm-common for reference documentation generation. Fixes
    bgo#583411, bgo#614260, bgo#551501
  + Fix several compiler warnings.
  + Use 0 instead of NULL.
- Rebase libxml++-2.24.0-pkgconfig-requires-private.patch.
- Create a libxml++-2_6-2 subpackage to follow the library policy.
  It provides/obsoletes libxml++.
- Update build/install sections as well as the file list because of
  the build system rewrite.
* Wed Jul 29 2009 vuntz@novell.com
- Remove unneeded update-desktop-files BuildRequires.
* Tue Jul 28 2009 lmedinas@gmail.com
- Update to version 2.26.1:
  + Build fixes
  + Build without exceptions
* Mon Mar 16 2009 vuntz@novell.com
- Update to version 2.26.0:
  + Increased version number to match GNOME 2.26.
- Remove AutoReqProv: it's default now.
* Fri Mar 13 2009 mboman@suse.de
- Update to version 2.24.3:
  + TextReader: Actually throw exceptions on errors (This breaks
    ABI but we do not believe that this class could be used with
    this problem so it should not actually break any application.)
  + Build: Windows: Remove unnecessary vsnprint define.
- Don't run autoreconf
* Tue Jan 13 2009 crrodriguez@suse.de
- remove static libraries and "la" files
- corrct -devel package dependencies
* Mon Dec 29 2008 mboman@suse.de
- Update to version 2.24.2:
  * Fixed another two memory leaks (bgo#563321)
  * Removed obsolete MSVC6 project files
* Sat Dec 20 2008 mboman@suse.de
- Update to version 2.24.1:
  + Added new Schema and SchemaValidator classes to MSVC project files
  + Avoid a memory leak in Validator::check_for_exception.
  + Avoid a memory leak in schema class.
* Fri Oct  3 2008 mboman@suse.de
- Update to version 2.24.0:
  + Added Schema and SchemaValidator classes, demonstrated in
    examples/schemavalidation. bgo#312216
  + Element: Added add_child_text() with a previous_node parameter, for
    adding between existing nodes. Added add_child_text_before() too.
  + Node: Added add_child() with a previous_node parameter, for adding
    between existing nodes. Added add_child_before() too.
  + SaxParser: added parse_chunk_raw().
* Sun Aug 24 2008 mboman@novell.com
- Upgraded to version 2.23.3:
  * Attribute: Return the correct value even when using a namespace.
    bgo#547689
  * Fixed MSVC++ Windows build.
  * SaxParser: added parse_chunk_raw().
  * examples: sax_parser: Catch convert errors when printing an exception to
    std:cout, though libxml++/libxml should always supply valid UTF-8.
  * Added Schema and SchemaValidator classes, demonstrated in
    examples/schemavalidation. bgo#312216.
  * Element: Added add_child_text() with a previous_node parameter, for
    adding between existing nodes. Added add_child_text_before() too.
  * Node: Added add_child() with a previous_node parameter, for adding
    between existing nodes. Added add_child_before() too.
* Thu Apr  3 2008 hpj@suse.de
- Upgraded to version 2.22.0:
  * Document: Fix a memory leak, by calling xmlCleanupParser
  in the destructor.
  * Build: Fix the build with gcc 4.3 pre-releases.
- Removed libxml++-include-memory.patch, now in upstream.
* Tue Nov 20 2007 maw@suse.de
- Add libxml++-include-memory.patch
- Use %%fdupes.
* Wed Sep 19 2007 sbrabec@suse.cz
- Updated to version 2.20.0:
  * Element: Added get_attribute_value(), to get a simple text
    value for an attribute.
  * Added an experimental --enable-api-exceptions configure option,
    to allow libxml++ to build without exceptions.
* Thu Apr 12 2007 maw@suse.de
- Update to version 2.18.0
- Fixes for bugzilla.gnome.org #380110, #351867, #361950, #351215,
  and #351876.
* Fri Jan 12 2007 sbrabec@suse.cz
- Spec file cleanup.
* Fri Dec 15 2006 maw@suse.de
- Move to /usr
* Tue Nov 28 2006 sbrabec@suse.cz
- Require new package name glibmm2-devel.
* Tue Oct 31 2006 meissner@suse.de
- use RPM_OPT_FLAGS
* Mon Sep 18 2006 jhargadon@suse.de
- update to version 2.14.0
- Improved ContentNode documentation
- Added find() overload that takes namespaces to register during the search,
  using xmlXPathRegisterNs(). Bug #323935
- set_namespace(): When creating a default namespace, avoid the
  "The namespace () has not been declared" warning, by passing 0 to
  xmlSearchNs() instead of an empty string. Bug #318186
- Build: Fix buildir!=srcdir builds. Bug #319863.
- Tutorial: Mention pkg-config
- Reference: Grammar fixes and a small fix for find
* Fri Mar 24 2006 ro@suse.de
- re-enable autoreconf to fix build on ppc64 and s390x
* Mon Feb 27 2006 aj@suse.de
- Reduce BuildRequires.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Nov  4 2005 gekker@suse.de
- Initial import of package into autobuild, version 2.12.0