2021-10-21 15:39:33 +00:00
|
|
|
|
%global forgeurl https://gitlab.gnome.org/GNOME/gi-docgen
|
2021-07-04 13:13:58 +00:00
|
|
|
|
%global tag %{version}
|
|
|
|
|
|
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.
|
|
|
|
|
#
|
|
|
|
|
# We can generate PDF documentation as a lesser substitute.
|
|
|
|
|
%bcond_without doc_pdf
|
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
Name: gi-docgen
|
2021-08-16 13:39:19 +00:00
|
|
|
|
Version: 2021.7
|
2021-07-04 13:13:58 +00:00
|
|
|
|
%forgemeta
|
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
|
|
|
|
|
|
|
|
|
|
# The entire source is (ASL 2.0 or GPLv3+) except:
|
|
|
|
|
#
|
|
|
|
|
# MIT:
|
|
|
|
|
# - gidocgen/templates/basic/fzy.js
|
|
|
|
|
#
|
|
|
|
|
# CC0:
|
|
|
|
|
# - docs/CODEOWNERS (-doc subpackage)
|
|
|
|
|
# - examples/*.toml (-doc subpackage)
|
|
|
|
|
# - gi-docgen.doap (not installed)
|
|
|
|
|
# - gidocgen/porter.py
|
|
|
|
|
# - MANIFEST.in (not installed)
|
|
|
|
|
#
|
|
|
|
|
# CC-BY:
|
|
|
|
|
# - code-of-conduct.md (-doc subpackage)
|
|
|
|
|
#
|
|
|
|
|
# OFL:
|
|
|
|
|
# - gidocgen/templates/basic/RedHat* (removed in prep)
|
|
|
|
|
# - gidocgen/templates/basic/SourceCodePro* (removed in prep)
|
|
|
|
|
License: (ASL 2.0 or GPLv3+) and MIT and CC0
|
|
|
|
|
URL: %{forgeurl}
|
|
|
|
|
Source0: %{forgesource}
|
|
|
|
|
|
|
|
|
|
# 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.
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Patch0: gi-docgen-2021.6-no-web-fonts.patch
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
License: (ASL 2.0 or GPLv3+)
|
|
|
|
|
|
|
|
|
|
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
|
2021-07-04 13:13:58 +00:00
|
|
|
|
License: (ASL 2.0 or GPLv3+) and CC0 and CC-BY
|
|
|
|
|
|
|
|
|
|
%description doc
|
2021-10-21 15:39:33 +00:00
|
|
|
|
Documentation for gi-docgen.
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
2021-09-29 13:46:17 +00:00
|
|
|
|
# There are no upstream tests to run; but we add the runtime requirements as
|
|
|
|
|
# BR’s anyway so that the build will fail if some are not available in the
|
|
|
|
|
# distribution.
|
2021-07-04 13:13:58 +00:00
|
|
|
|
%pyproject_buildrequires -r
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
|
|
# Remove all bundled fonts. See Patch0.
|
|
|
|
|
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}
|
|
|
|
|
sphinx-build -b latex docs %{_vpath_builddir}/_latex
|
|
|
|
|
%make_build -C %{_vpath_builddir}/_latex
|
|
|
|
|
%endif
|
2021-07-04 13:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%pyproject_save_files gidocgen
|
|
|
|
|
|
|
|
|
|
install -t '%{buildroot}%{_pkgdocdir}' -D -m 0644 -p \
|
|
|
|
|
code-of-conduct.md \
|
|
|
|
|
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}/'
|
|
|
|
|
|
|
|
|
|
|
2021-09-29 13:46:17 +00:00
|
|
|
|
# There are no upstream tests to run.
|
|
|
|
|
|
|
|
|
|
|
2021-07-04 13:13:58 +00:00
|
|
|
|
%files -f %{pyproject_files}
|
|
|
|
|
%license LICENSES/*.txt
|
|
|
|
|
|
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
|
|
|
|
|
%license LICENSES/*.txt
|
|
|
|
|
%doc %{_pkgdocdir}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
2021-07-20 20:40:12 +00:00
|
|
|
|
%autochangelog
|