%bcond_with bootstrap %define url_ver %{lua: ver = rpm.expand("%{version}"); majmin, count1 = string.gsub(ver, "^([0123456789]+%.[0123456789]+).*", "%1", 1); if count1 == 0 then print(ver); return; end; maj, count2 = string.gsub(majmin, "^([0123456789]+).*", "%1", 1); if count2 == 0 then print(majmin) elseif tonumber(majmin) < 40 then print(majmin) else print(maj) end} %global __python %{__python3} Name: gtk-doc Version: 1.33.2 Release: %mkrel 1 Summary: API documentation generation tool for GTK+ and GNOME License: GPLv2+ and GFDL Group: Development/GNOME and GTK+ URL: https://developer.gnome.org/gtk-doc-manual/stable/ Source0: https://download.gnome.org/sources/gtk-doc/%{url_ver}/%{name}-%{version}.tar.xz BuildArch: noarch BuildRequires: xsltproc BuildRequires: source-highlight BuildRequires: yelp-tools BuildRequires: itstool %if ! %{with bootstrap} # for the testsuite: BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: python3dist(anytree) BuildRequires: python3dist(pygments) BuildRequires: python3dist(parameterized) BuildRequires: python3dist(lxml) BuildRequires: bc # for pdflatex: BuildRequires: dblatex >= 0.3.11-4 BuildRequires: texlive-dist %endif # Following are not automatically installed Requires: xsltproc Requires: docbook-utils Requires: docbook-dtds Requires: docbook-style-xsl %if ! %{with bootstrap} Requires: python3-pygments Requires: python3-six %endif Requires: source-highlight %description gtk-doc is a tool for generating API reference documentation. It is used for generating the documentation for GTK+, GLib and GNOME. %package mkpdf Summary: API documentation PDF format generation tool for GTK+ and GNOME Group: Development/GNOME and GTK+ Requires: %{name} = %version %if ! %{with bootstrap} Requires: dblatex %endif %description mkpdf gtkdoc-mkpdf is a tool for generating API reference documentation in PDF format. it is used for generating the documentation for GTK+, GLib and GNOME. %prep %autosetup -p1 # Move this doc file to avoid name collisions mv doc/README doc/README.docs %build export PYTHON=%{__python3} export PKG_CONFIG=%{_bindir}/pkg-config autoreconf -fi %configure \ --with-noarch-pkgconfigdir %make_build %install %make_install # include shared directory install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html %find_lang %{name}-manual --with-gnome %if ! %{with bootstrap} %check # For reasons unknown first make check fails with texlive debug spew in log # files. Just run it twice to work this around. PATH=%{buildroot}%{_bindir}:$PATH make check %endif %files -f %{name}-manual.lang %doc AUTHORS README doc/* examples %{_bindir}/gtkdoc-check %{_bindir}/gtkdoc-depscan %{_bindir}/gtkdoc-fixxref %{_bindir}/gtkdoc-mkdb %{_bindir}/gtkdoc-mkhtml %{_bindir}/gtkdoc-mkhtml2 %{_bindir}/gtkdoc-mkman %{_bindir}/gtkdoc-rebase %{_bindir}/gtkdoc-scan %{_bindir}/gtkdoc-scangobj %{_bindir}/gtkdocize %{_datadir}/gtk-doc %{_datadir}/pkgconfig/* %{_datadir}/aclocal/* %{_datadir}/cmake/GtkDoc %files mkpdf %{_bindir}/gtkdoc-mkpdf