gi-docgen/gi-docgen.spec

197 lines
5.7 KiB
RPMSpec
Raw Normal View History

%global forgeurl https://gitlab.gnome.org/GNOME/gi-docgen
2021-07-04 13:13:58 +00:00
%global tag %{version}
# 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 havent 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.
Patch0: gi-docgen-2021.6-no-web-fonts.patch
2021-07-04 13:13:58 +00:00
BuildArch: noarch
BuildRequires: python3-devel
# Documentation
%if %{with doc_pdf}
2021-07-04 13:13:58 +00:00
BuildRequires: make
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
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:
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, its not clear
# how we could unbundle it, either downstream or with some kind of upstream
# support.
#
# Its 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
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
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
Documentation for gi-docgen.
2021-07-04 13:13:58 +00:00
%generate_buildrequires
# There are no upstream tests to run; but we add the runtime requirements as
# BRs 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
%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
%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}/'
# There are no upstream tests to run.
2021-07-04 13:13:58 +00:00
%files -f %{pyproject_files}
%license LICENSES/*.txt
%{_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.
%{_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