File gtk-doc.spec of Package gtk-doc

# spec file for package gtk-doc
# Copyright (c) 2019 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

%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "doc"
%bcond_without  doc
%define psuffix -manual
%bcond_with     doc

Name:           gtk-doc%{?psuffix}
Version:        1.32
Release:        0
%if "%{flavor}" == ""
Summary:        GTK+ Documentation Generator
License:        GPL-2.0-or-later
Group:          Productivity/Publishing/SGML
Summary:        Manual for Gtkdoc
License:        GFDL-1.1-or-later
Group:          Documentation/HTML
# When updating this package, please don't forget to update the gtk-doc.m4 Source in glib2.

BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libtool
BuildRequires:  libxml2-tools
BuildRequires:  pkgconfig
BuildRequires:  python3-base
BuildRequires:  sgml-skel
%if %{with doc}
BuildRequires:  fdupes
BuildRequires:  yelp-tools
# gtk-doc-manual was split from the main package
Provides:       gtk-doc:%{_datadir}/help/C/gtk-doc-manual/index.docbook
Conflicts:      gtk-doc < %{version}-%{release}
Conflicts:      gtk-doc-lang < %{version}-%{release}
BuildRequires:  xsltproc
Requires:       docbook-xsl-stylesheets
Requires:       docbook_4
Requires:       glib2-devel
Requires:       libxml2-tools
Requires:       python3-pygments
Requires:       xsltproc
Recommends:     gtk-doc-manual
# Old for <= 10.2 & CODE10
Provides:       gtkdoc = %{version}
Obsoletes:      gtkdoc

%if "%{flavor}" == ""
Gtkdoc is a set of Python scripts that generates API reference
documentation in e.g DocBook, HTML or PDF format.  It can extract
documentation from source code comments in a manner similar to
Java-doc.  It is used to generate the documentation for GLib,
Gtk+, and GNOME.

User manual for Gtkdoc

%package mkpdf
Summary:        Gtkdoc PDF Generator
Supplements:    packageand(gtk-doc:dblatex)
Requires:       %{name} = %{version}
Requires:       dblatex

%description mkpdf
PDF generator for Gtkdoc.

%lang_package -n gtk-doc-manual

%autosetup -p1 -n gtk-doc-%{version}

%configure PYTHON=%{_bindir}/python3 \
make %{?_smp_mflags}

%if "%{flavor}" == ""
mkdir -p %{buildroot}%{_datadir}/gtk-doc/html

%if %{with doc}
%make_install -C help
%fdupes %{buildroot}%{_datadir}/help/[a-z]*
%find_lang gtk-doc-manual %{?no_lang_C}

%if "%{flavor}" == ""
%license COPYING
%exclude %{_bindir}/gtkdoc-mkpdf
%dir %{_datadir}/aclocal
%exclude %{_datadir}/gtk-doc/python/gtkdoc/mkpdf*
%dir %{_datadir}/cmake
%dir %{_datadir}/cmake/GtkDoc

%files mkpdf

%if %{with doc}
%files -n gtk-doc-manual
%doc %{_datadir}/help/C/gtk-doc-manual

%files -n gtk-doc-manual-lang -f gtk-doc-manual.lang