gi-docgen/gi-docgen.spec

231 lines
6.8 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.
#
2021-11-27 02:03:25 +00:00
# We can generate PDF documentation as a substitute.
%bcond_without doc_pdf
2021-07-04 13:13:58 +00:00
Name: gi-docgen
2022-02-16 20:29:01 +00:00
Version: 2022.1
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
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.
#
# The entire source is (ASL 2.0 or GPLv3+) except the following files that are
# 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
#
# CC0:
2022-02-16 20:29:01 +00:00
# - .editorconfig (not packaged)
# - .gitlab-ci.yml (not packaged)
# - 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)
# - gi-docgen.doap (not installed)
# - gidocgen/porter.py
# - MANIFEST.in (not installed)
#
2022-02-16 20:29:01 +00:00
# CC-BY-SA:
2021-07-04 13:13:58 +00:00
# - code-of-conduct.md (-doc subpackage)
#
2022-02-16 20:29:01 +00:00
# Additionally, the following sources are under licenses other than (ASL 2.0 or
# GPLv3+), but are not packaged in any of the binary RPMs:
#
# CC0:
# - .editorconfig (not packaged)
# - .gitlab-ci.yml (not packaged)
# - gi-docgen.doap (not installed)
# - MANIFEST.in (not installed)
# - pytest.ini (not installed)
#
# CC-BY-SA
# - docs/gi-docgen.{png,svg} (for HTML docs; not currently packaged)
#
2021-07-04 13:13:58 +00:00
# OFL:
2022-02-16 20:29:01 +00:00
# - gidocgen/templates/basic/*.{woff,woff2} (removed in prep)
#
# GPLv2+:
# - test/gir/{Utility-1.0,Regress-1.0}.gir (not packaged; test only)
#
# LGPLv2+:
# - test/gir/{GLib,GObject,Gio}-2.0.gir (not packaged; test only)
#
# (LGPLv2+ or MPLv1.1):
# - test/gir/cairo-1.0.gir (not packaged; test only)
2021-07-04 13:13:58 +00:00
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.
2021-10-21 15:33:43 +00:00
Patch0: gi-docgen-2021.8-no-web-fonts.patch
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
%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
2022-02-16 20:29:01 +00:00
License: (ASL 2.0 or GPLv3+) and CC0 and CC-BY-SA
2021-07-04 13:13:58 +00:00
%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
2021-11-27 02:03:25 +00:00
%make_build -C %{_vpath_builddir}/_latex LATEXMKOPTS='-quiet'
%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}/'
2022-02-16 20:29:01 +00:00
%check
%pytest
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
%{_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
2022-02-16 20:29:01 +00:00
%license LICENSES/*.txt .reuse/dep5
2021-07-04 13:13:58 +00:00
%doc %{_pkgdocdir}
%changelog
2021-07-20 20:40:12 +00:00
%autochangelog