2021-09-27 17:52:52 +00:00
|
|
|
|
# Sphinx-generated HTML documentation is not suitable for packaging; see
|
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
|
|
|
|
|
#
|
2021-11-27 02:03:25 +00:00
|
|
|
|
# We can generate PDF documentation as a substitute.
|
2021-09-27 17:52:52 +00:00
|
|
|
|
%bcond_without doc_pdf
|
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
Name: gi-docgen
|
2023-01-07 15:13:14 +00:00
|
|
|
|
Version: 2023.1
|
2021-07-20 20:40:12 +00:00
|
|
|
|
Release: %autorelease
|
2021-07-04 13:13:58 +00:00
|
|
|
|
Summary: Documentation tool for GObject-based libraries
|
|
|
|
|
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# Based on the “Copyright and Licensing terms” in README.md, on the contents of
|
|
|
|
|
# .reuse/dep5, and on inspection of SPDX headers or other file contents with
|
|
|
|
|
# assistance from licensecheck.
|
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# The entire source is (Apache-2.0 OR GPL-3.0-or-later) except the following files that are
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# packaged or are used to generate packaged files:
|
2021-07-04 13:13:58 +00:00
|
|
|
|
#
|
|
|
|
|
# MIT:
|
|
|
|
|
# - gidocgen/templates/basic/fzy.js
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# - gidocgen/templates/basic/solarized-{dark,light}.js
|
2021-07-04 13:13:58 +00:00
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# CC0-1.0:
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# - gi-docgen.pc.in (from which gi-docgen.pc is generated)
|
|
|
|
|
# - gidocgen/templates/basic/*.png
|
2021-07-04 13:13:58 +00:00
|
|
|
|
# - docs/CODEOWNERS (-doc subpackage)
|
|
|
|
|
# - examples/*.toml (-doc subpackage)
|
2022-11-11 13:17:43 +00:00
|
|
|
|
#
|
|
|
|
|
# Note that CC0-1.0 is allowed for content only; these files may reasonably be
|
|
|
|
|
# called content.
|
2021-07-04 13:13:58 +00:00
|
|
|
|
#
|
2023-05-26 16:59:01 +00:00
|
|
|
|
# Additionally, the following sources are under licenses other than (Apache-2.0
|
|
|
|
|
# OR GPL-3.0-or-later), but are not packaged in any of the binary RPMs:
|
2022-02-16 20:29:01 +00:00
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# CC0-1.0:
|
2022-11-10 16:18:55 +00:00
|
|
|
|
# - .editorconfig (not installed)
|
|
|
|
|
# - .gitlab-ci.yml (not installed)
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# - gi-docgen.doap (not installed)
|
|
|
|
|
# - MANIFEST.in (not installed)
|
|
|
|
|
# - pytest.ini (not installed)
|
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# CC-BY-SA-3.0:
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# - docs/gi-docgen.{png,svg} (for HTML docs; not currently packaged)
|
2022-11-10 16:18:55 +00:00
|
|
|
|
# - code-of-conduct.md (not installed)
|
2022-02-16 20:29:01 +00:00
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# OFL-1.1:
|
2022-02-16 20:29:01 +00:00
|
|
|
|
# - gidocgen/templates/basic/*.{woff,woff2} (removed in prep)
|
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# GPL-2.0-or-later:
|
2022-11-10 16:18:55 +00:00
|
|
|
|
# - test/gir/{Utility-1.0,Regress-1.0}.gir (not installed; test only)
|
2022-02-16 20:29:01 +00:00
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# LGPL-2.0-or-later:
|
2022-11-10 16:18:55 +00:00
|
|
|
|
# - test/gir/{GLib,GObject,Gio}-2.0.gir (not installed; test only)
|
2022-02-16 20:29:01 +00:00
|
|
|
|
#
|
2022-11-11 13:17:43 +00:00
|
|
|
|
# LGPL-2.0-or-later OR MPL-1.1:
|
2022-11-10 16:18:55 +00:00
|
|
|
|
# - test/gir/cairo-1.0.gir (not installed; test only)
|
2022-11-11 13:17:43 +00:00
|
|
|
|
License: (Apache-2.0 OR GPL-3.0-or-later) AND MIT AND CC0-1.0
|
2022-04-20 16:53:43 +00:00
|
|
|
|
URL: https://gitlab.gnome.org/GNOME/gi-docgen
|
2023-05-26 16:59:38 +00:00
|
|
|
|
Source: %{url}/-/archive/%{version}/gi-docgen-%{version}.tar.bz2
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
# We are prohibited from bundling fonts, and we are prohibited from shipping
|
|
|
|
|
# fonts in web font formats; see
|
|
|
|
|
# https://docs.fedoraproject.org/en-US/packaging-guidelines/FontsPolicy/#_web_fonts.
|
|
|
|
|
#
|
|
|
|
|
# Since upstream uses *only* web fonts, we need a patch. We haven’t offered it
|
|
|
|
|
# upstream since upstream has no reason NOT to use web fonts.
|
|
|
|
|
#
|
|
|
|
|
# This patch removes all references to WOFF/WOFF2 font files (which we still
|
|
|
|
|
# must remove in %%prep) and ensures the CSS correctly references corresponding
|
|
|
|
|
# local system fonts.
|
2022-11-11 12:54:06 +00:00
|
|
|
|
Patch: gi-docgen-2022.2-no-web-fonts.patch
|
2022-12-30 16:38:25 +00:00
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
|
2022-02-16 20:29:01 +00:00
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
# Documentation
|
2021-09-27 17:52:52 +00:00
|
|
|
|
%if %{with doc_pdf}
|
2021-07-04 13:13:58 +00:00
|
|
|
|
BuildRequires: make
|
|
|
|
|
BuildRequires: python3dist(sphinx)
|
|
|
|
|
BuildRequires: python3dist(sphinx-rtd-theme)
|
2021-09-27 17:52:52 +00:00
|
|
|
|
BuildRequires: python3-sphinx-latex
|
|
|
|
|
BuildRequires: latexmk
|
|
|
|
|
%endif
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
# Unbundling fonts:
|
|
|
|
|
BuildRequires: font(redhatdisplay)
|
|
|
|
|
BuildRequires: font(redhatdisplayblack)
|
|
|
|
|
BuildRequires: font(redhatdisplaymedium)
|
|
|
|
|
BuildRequires: font(redhattext)
|
|
|
|
|
BuildRequires: font(redhattextmedium)
|
|
|
|
|
BuildRequires: font(sourcecodepro)
|
|
|
|
|
BuildRequires: font(sourcecodeprosemibold)
|
|
|
|
|
|
|
|
|
|
# Unbundling fonts:
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Requires: gi-docgen-fonts = %{version}-%{release}
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
# Trivial fork of https://github.com/jhawthorn/fzy.js (looks like it was
|
|
|
|
|
# basically just wrapped in an IIFE). Given that modification, it’s not clear
|
|
|
|
|
# how we could unbundle it, either downstream or with some kind of upstream
|
|
|
|
|
# support.
|
|
|
|
|
#
|
|
|
|
|
# It’s not clear what version was used for the fork.
|
|
|
|
|
Provides: bundled(js-fzy)
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
GI-DocGen is a document generator for GObject-based libraries. GObject is the
|
|
|
|
|
base type system of the GNOME project. GI-Docgen reuses the introspection data
|
|
|
|
|
generated by GObject-based libraries to generate the API reference of these
|
|
|
|
|
libraries, as well as other ancillary documentation.
|
|
|
|
|
|
|
|
|
|
GI-DocGen is not a general purpose documentation tool for C libraries.
|
|
|
|
|
|
|
|
|
|
While GI-DocGen can be used to generate API references for most GObject/C
|
|
|
|
|
libraries that expose introspection data, its main goal is to generate the
|
|
|
|
|
reference for GTK and its immediate dependencies. Any and all attempts at
|
|
|
|
|
making this tool more generic, or to cover more use cases, will be weighted
|
|
|
|
|
heavily against its primary goal.
|
|
|
|
|
|
|
|
|
|
GI-DocGen is still in development. The recommended use of GI-DocGen is to add
|
|
|
|
|
it as a sub-project to your Meson build system, and vendor it when releasing
|
|
|
|
|
dist archives.
|
|
|
|
|
|
|
|
|
|
You should not depend on a system-wide installation until GI-DocGen is declared
|
|
|
|
|
stable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package fonts
|
|
|
|
|
Summary: Metapackage providing fonts for gi-docgen output
|
|
|
|
|
# Really, there is nothing copyrightable in this metapackage, so we give it the
|
|
|
|
|
# overall license of the project.
|
2022-11-11 13:17:43 +00:00
|
|
|
|
License: Apache-2.0 OR GPL-3.0-or-later
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
Requires: font(redhatdisplay)
|
|
|
|
|
Requires: font(redhatdisplayblack)
|
|
|
|
|
Requires: font(redhatdisplaymedium)
|
|
|
|
|
Requires: font(redhattext)
|
|
|
|
|
Requires: font(redhattextmedium)
|
|
|
|
|
Requires: font(sourcecodepro)
|
|
|
|
|
Requires: font(sourcecodeprosemibold)
|
|
|
|
|
|
|
|
|
|
%description fonts
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Because web fonts from upstream are not bundled in the gi-docgen package,
|
|
|
|
|
documentation packages generated with gi-docgen must depend on this metapackage
|
2021-07-04 13:13:58 +00:00
|
|
|
|
to ensure the proper system fonts are present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package doc
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Summary: Documentation for gi-docgen
|
2022-11-11 13:17:43 +00:00
|
|
|
|
License: (Apache-2.0 OR GPL-3.0-or-later) AND CC0-1.0
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
%description doc
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Documentation for gi-docgen.
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
2022-11-10 16:19:46 +00:00
|
|
|
|
%pyproject_buildrequires
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
2022-04-16 13:11:53 +00:00
|
|
|
|
# Remove all bundled fonts. See gi-docgen-*-no-web-fonts.patch.
|
2021-07-04 13:13:58 +00:00
|
|
|
|
find . -type f \( -name '*.woff' -o -name '*.woff2' \) -print -delete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
2021-09-27 17:52:52 +00:00
|
|
|
|
%if %{with doc_pdf}
|
2023-03-17 11:52:47 +00:00
|
|
|
|
sphinx-build -b latex -j%{?_smp_build_ncpus} docs %{_vpath_builddir}/_latex
|
2021-11-27 02:03:25 +00:00
|
|
|
|
%make_build -C %{_vpath_builddir}/_latex LATEXMKOPTS='-quiet'
|
2021-09-27 17:52:52 +00:00
|
|
|
|
%endif
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%pyproject_save_files gidocgen
|
|
|
|
|
|
|
|
|
|
install -t '%{buildroot}%{_pkgdocdir}' -D -m 0644 -p \
|
2023-01-07 15:13:14 +00:00
|
|
|
|
CHANGES.md \
|
2021-07-04 13:13:58 +00:00
|
|
|
|
CONTRIBUTING.md \
|
|
|
|
|
docs/CODEOWNERS \
|
|
|
|
|
README.md
|
2021-09-27 17:52:52 +00:00
|
|
|
|
%if %{with doc_pdf}
|
|
|
|
|
install -t '%{buildroot}%{_pkgdocdir}' -p -m 0644 \
|
|
|
|
|
'%{_vpath_builddir}/_latex/gi-docgen.pdf'
|
|
|
|
|
%endif
|
2021-07-04 13:13:58 +00:00
|
|
|
|
cp -rp examples '%{buildroot}%{_pkgdocdir}/'
|
|
|
|
|
|
|
|
|
|
|
2022-02-16 20:29:01 +00:00
|
|
|
|
%check
|
|
|
|
|
%pytest
|
2021-09-29 13:46:17 +00:00
|
|
|
|
|
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
%files -f %{pyproject_files}
|
2022-02-16 20:29:01 +00:00
|
|
|
|
%license LICENSES/*.txt .reuse/dep5
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
2021-10-21 15:39:33 +00:00
|
|
|
|
%{_bindir}/gi-docgen
|
|
|
|
|
%{_mandir}/man1/gi-docgen.1*
|
2021-07-04 13:13:58 +00:00
|
|
|
|
# Normally, this would go in a -devel package, but there is little point in
|
|
|
|
|
# providing a -devel package for *just* the .pc file when there are no
|
|
|
|
|
# libraries or headers.
|
2021-10-21 15:39:33 +00:00
|
|
|
|
%{_datadir}/pkgconfig/gi-docgen.pc
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files fonts
|
|
|
|
|
# Empty; this is a metapackage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files doc
|
2022-02-16 20:29:01 +00:00
|
|
|
|
%license LICENSES/*.txt .reuse/dep5
|
2023-05-26 17:00:09 +00:00
|
|
|
|
%doc %{_pkgdocdir}/
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
2021-07-20 20:40:12 +00:00
|
|
|
|
%autochangelog
|