commit aa451916355414a6dc37c4cea3554a38e81e8d32 Author: Toshaan Bharvani Date: Wed Apr 5 23:51:46 2023 +0200 iniital package creation Signed-off-by: Toshaan Bharvani diff --git a/SOURCES/gi-docgen-2022.2-no-web-fonts.patch b/SOURCES/gi-docgen-2022.2-no-web-fonts.patch new file mode 100644 index 0000000..996771f --- /dev/null +++ b/SOURCES/gi-docgen-2022.2-no-web-fonts.patch @@ -0,0 +1,239 @@ +diff -Naur gi-docgen-2022.2-original/gidocgen/templates/basic/basic.toml gi-docgen-2022.2/gidocgen/templates/basic/basic.toml +--- gi-docgen-2022.2-original/gidocgen/templates/basic/basic.toml 2022-11-07 09:50:06.000000000 -0500 ++++ gi-docgen-2022.2/gidocgen/templates/basic/basic.toml 2022-11-11 08:23:51.069820380 -0500 +@@ -42,35 +42,4 @@ + "solarized-light.css", + "solarized-dark.css", + "search.js", +- "RedHatDisplay-Black.woff", +- "RedHatDisplay-Black.woff2", +- "RedHatDisplay-BlackItalic.woff", +- "RedHatDisplay-BlackItalic.woff2", +- "RedHatDisplay-Bold.woff", +- "RedHatDisplay-Bold.woff2", +- "RedHatDisplay-BoldItalic.woff", +- "RedHatDisplay-BoldItalic.woff2", +- "RedHatDisplay-Italic.woff", +- "RedHatDisplay-Italic.woff2", +- "RedHatDisplay-Medium.woff", +- "RedHatDisplay-Medium.woff2", +- "RedHatDisplay-MediumItalic.woff", +- "RedHatDisplay-MediumItalic.woff2", +- "RedHatDisplay-Regular.woff", +- "RedHatDisplay-Regular.woff2", +- "RedHatText-Bold.woff", +- "RedHatText-Bold.woff2", +- "RedHatText-BoldItalic.woff", +- "RedHatText-BoldItalic.woff2", +- "RedHatText-Italic.woff", +- "RedHatText-Italic.woff2", +- "RedHatText-Medium.woff", +- "RedHatText-Medium.woff2", +- "RedHatText-MediumItalic.woff", +- "RedHatText-MediumItalic.woff2", +- "RedHatText-Regular.woff", +- "RedHatText-Regular.woff2", +- "SourceCodePro-It.ttf.woff", +- "SourceCodePro-Regular.ttf.woff", +- "SourceCodePro-Semibold.ttf.woff", + ] +diff -Naur gi-docgen-2022.2-original/gidocgen/templates/basic/fonts.css gi-docgen-2022.2/gidocgen/templates/basic/fonts.css +--- gi-docgen-2022.2-original/gidocgen/templates/basic/fonts.css 2022-11-07 09:50:06.000000000 -0500 ++++ gi-docgen-2022.2/gidocgen/templates/basic/fonts.css 2022-11-11 08:23:51.069820380 -0500 +@@ -14,9 +14,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-Regular.woff2") format("woff2"), +- url("RedHatDisplay-Regular.woff") format("woff"); ++ src: local('RedHatDisplay-Regular'); + font-style: normal; + font-weight: 400; + font-display: fallback; +@@ -24,9 +22,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-RegularItalic.woff2") format("woff2"), +- url("RedHatDisplay-RegularItalic.woff") format("woff"); ++ src: local('RedHatDisplay-RegularItalic'); + font-style: italic; + font-weight: 400; + font-display: fallback; +@@ -34,9 +30,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-Medium.woff2") format("woff2"), +- url("RedHatDisplay-Medium.woff") format("woff"); ++ src: local('RedHatDisplay-Medium'); + font-style: normal; + font-weight: 500; + font-display: fallback; +@@ -44,9 +38,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-MediumItalic.woff2") format("woff2"), +- url("RedHatDisplay-MediumItalic.woff") format("woff"); ++ src: local('RedHatDisplay-MediumItalic'); + font-style: italic; + font-weight: 500; + font-display: fallback; +@@ -54,9 +46,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-Bold.woff2") format("woff2"), +- url("RedHatDisplay-Bold.woff") format("woff"); ++ src: local('RedHatDisplay-Bold'); + font-style: normal; + font-weight: 700; + font-display: fallback; +@@ -64,9 +54,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-BoldItalic.woff2") format("woff2"), +- url("RedHatDisplay-BoldItalic.woff") format("woff"); ++ src: local('RedHatDisplay-BoldItalic'); + font-style: italic; + font-weight: 700; + font-display: fallback; +@@ -75,9 +63,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-Black.woff2") format("woff2"), +- url("RedHatDisplay-Black.woff") format("woff"); ++ src: local('RedHatDisplay-Black'); + font-style: normal; + font-weight: 900; + font-display: fallback; +@@ -85,9 +71,7 @@ + + @font-face { + font-family: "Red Hat Display"; +- src: local('RedHatDisplayWeb'), +- url("RedHatDisplay-BlackItalic.woff2") format("woff2"), +- url("RedHatDisplay-BlackItalic.woff") format("woff"); ++ src: local('RedHatDisplay-BlackItalic'); + font-style: italic; + font-weight: 900; + font-display: fallback; +@@ -95,9 +79,7 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-Regular.woff2") format("woff2"), +- url("RedHatText-Regular.woff") format("woff"); ++ src: local('RedHatText-Regular'); + font-style: normal; + font-weight: 400; + font-display: fallback; +@@ -105,9 +87,7 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-Italic.woff2") format("woff2"), +- url("RedHatText-Italic.woff") format("woff"); ++ src: local('RedHatText-Italic'); + font-style: italic; + font-weight: 400; + font-display: fallback; +@@ -115,9 +95,7 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-Medium.woff2") format("woff2"), +- url("RedHatText-Medium.woff") format("woff"); ++ src: local('RedHatText-Medium'); + font-style: normal; + font-weight: 700; + font-display: fallback; +@@ -125,9 +103,7 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-MediumItalic.woff2") format("woff2"), +- url("RedHatText-MediumItalic.woff") format("woff"); ++ src: local('RedHatText-MediumItalic'); + font-style: italic; + font-weight: 700; + font-display: fallback; +@@ -135,9 +111,7 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-Bold.woff2") format("woff2"), +- url("RedHatText-Bold.woff") format("woff"); ++ src: local('RedHatText-Bold'); + font-style: normal; + font-weight: 900; + font-display: fallback; +@@ -145,22 +119,17 @@ + + @font-face { + font-family: "Red Hat Text"; +- src: local('RedHatTextWeb'), +- url("RedHatText-BoldItalic.woff2") format("woff2"), +- url("RedHatText-BoldItalic.woff") format("woff"); ++ src: local('RedHatText-BoldItalic'); + font-style: italic; + font-weight: 900; + font-display: fallback; + } + +-/* Do not fall back to locally installed SourceCodePro, as there are +- * known bad copies being distributed to this day +- */ + @font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; +- src: url("SourceCodePro-Regular.ttf.woff") format('woff'); ++ src: local('SourceCodePro-Regular'); + font-display: swap; + } + +@@ -168,7 +137,7 @@ + font-family: 'Source Code Pro'; + font-style: italic; + font-weight: 400; +- src: url("SourceCodePro-It.ttf.woff") format('woff'); ++ src: local('SourceCodePro-It'); + font-display: swap; + } + +@@ -176,6 +145,6 @@ + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 600; +- src: url("SourceCodePro-Semibold.ttf.woff") format('woff'); ++ src: local('SourceCodePro-Semibold'); + font-display: swap; + } +diff -Naur gi-docgen-2022.2-original/setup.cfg gi-docgen-2022.2/setup.cfg +--- gi-docgen-2022.2-original/setup.cfg 2022-11-07 09:50:06.000000000 -0500 ++++ gi-docgen-2022.2/setup.cfg 2022-11-11 08:24:25.200224213 -0500 +@@ -74,8 +74,6 @@ + templates/basic/*.html + templates/basic/*.js + templates/basic/*.png +- templates/basic/*.woff2 +- templates/basic/*.woff + py.typed + + [bdist_wheel] diff --git a/SPECS/gi-docgen.spec b/SPECS/gi-docgen.spec new file mode 100644 index 0000000..6c14f1d --- /dev/null +++ b/SPECS/gi-docgen.spec @@ -0,0 +1,305 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.0) +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 1; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# 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 substitute. +%bcond_without doc_pdf + +Name: gi-docgen +Version: 2023.1 +Release: %autorelease +Summary: Documentation tool for GObject-based libraries + +# 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 (Apache-2.0 OR GPL-3.0-or-later) except the following files that are +# packaged or are used to generate packaged files: +# +# MIT: +# - gidocgen/templates/basic/fzy.js +# - gidocgen/templates/basic/solarized-{dark,light}.js +# +# CC0-1.0: +# - gi-docgen.pc.in (from which gi-docgen.pc is generated) +# - gidocgen/templates/basic/*.png +# - docs/CODEOWNERS (-doc subpackage) +# - examples/*.toml (-doc subpackage) +# +# Note that CC0-1.0 is allowed for content only; these files may reasonably be +# called content. +# +# 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-1.0: +# - .editorconfig (not installed) +# - .gitlab-ci.yml (not installed) +# - gi-docgen.doap (not installed) +# - MANIFEST.in (not installed) +# - pytest.ini (not installed) +# +# CC-BY-SA-3.0: +# - docs/gi-docgen.{png,svg} (for HTML docs; not currently packaged) +# - code-of-conduct.md (not installed) +# +# OFL-1.1: +# - gidocgen/templates/basic/*.{woff,woff2} (removed in prep) +# +# GPL-2.0-or-later: +# - test/gir/{Utility-1.0,Regress-1.0}.gir (not installed; test only) +# +# LGPL-2.0-or-later: +# - test/gir/{GLib,GObject,Gio}-2.0.gir (not installed; test only) +# +# LGPL-2.0-or-later OR MPL-1.1: +# - test/gir/cairo-1.0.gir (not installed; test only) +License: (Apache-2.0 OR GPL-3.0-or-later) AND MIT AND CC0-1.0 +URL: https://gitlab.gnome.org/GNOME/gi-docgen +Source0: %{url}/-/archive/%{version}/gi-docgen-%{version}.tar.bz2 + +# 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. +Patch: gi-docgen-2022.2-no-web-fonts.patch + +BuildArch: noarch + +BuildRequires: python3-devel + +BuildRequires: python3dist(pytest) + +# Documentation +%if %{with doc_pdf} +BuildRequires: make +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(sphinx-rtd-theme) +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk +%endif + +# 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} + +# 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: Apache-2.0 OR GPL-3.0-or-later + +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 +to ensure the proper system fonts are present. + + +%package doc +Summary: Documentation for gi-docgen +License: (Apache-2.0 OR GPL-3.0-or-later) AND CC0-1.0 + +%description doc +Documentation for gi-docgen. + + +%generate_buildrequires +%pyproject_buildrequires + + +%prep +%autosetup -p1 + +# Remove all bundled fonts. See gi-docgen-*-no-web-fonts.patch. +find . -type f \( -name '*.woff' -o -name '*.woff2' \) -print -delete + + +%build +%pyproject_wheel + +%if %{with doc_pdf} +sphinx-build -b latex %{?_smp_mflags} docs %{_vpath_builddir}/_latex +%make_build -C %{_vpath_builddir}/_latex LATEXMKOPTS='-quiet' +%endif + + +%install +%pyproject_install +%pyproject_save_files gidocgen + +install -t '%{buildroot}%{_pkgdocdir}' -D -m 0644 -p \ + CHANGES.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 +cp -rp examples '%{buildroot}%{_pkgdocdir}/' + + +%check +%pytest + + +%files -f %{pyproject_files} +%license LICENSES/*.txt .reuse/dep5 + +%{_bindir}/gi-docgen +%{_mandir}/man1/gi-docgen.1* +# 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 + + +%files fonts +# Empty; this is a metapackage + + +%files doc +%license LICENSES/*.txt .reuse/dep5 +%doc %{_pkgdocdir} + + +%changelog +* Sat Jan 07 2023 Benjamin A. Beasley 2023.1-1 +- Update to 2023.1 (close RHBZ#2158850) + +* Sat Jan 07 2023 Benjamin A. Beasley 2022.2-4 +- Revert "Temporarily add explicit BR on pyproject-rpm-macros" + +* Sat Jan 07 2023 Miro Hrončok 2022.2-3 +- Use tomllib (tomli) instated of deprecated python3-toml + +* Sat Jan 07 2023 Benjamin A. Beasley 2022.2-2 +- Update License to SPDX + +* Sat Jan 07 2023 Benjamin A. Beasley 2022.2-1 +- Update to 2022.2 (close RHBZ#2140725) + +* Sat Jan 07 2023 Benjamin A. Beasley 2022.1-11 +- Drop explicit -r for pyproject_buildrequires; no longer needed + +* Sat Jan 07 2023 Benjamin A. Beasley 2022.1-10 +- Drop code-of-conduct.md from the -doc subpackage + +* Wed Nov 16 2022 Benjamin A. Beasley 2022.1-9 +- Initial package for EPEL9 (close RHBZ#2072649) + +* Thu Nov 03 2022 Benjamin A. Beasley 2022.1-8 +- Temporarily add explicit BR on pyproject-rpm-macros + +* Tue Aug 23 2022 Benjamin A. Beasley 2022.1-7 +- Parallelize sphinx-build + +* Thu Jul 21 2022 Fedora Release Engineering 2022.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint 2022.1-5 +- Rebuilt for Python 3.11 + +* Wed Apr 20 2022 Benjamin A. Beasley 2022.1-4 +- Drop “forge” macros, which are not doing much here + +* Sat Apr 16 2022 Benjamin A. Beasley 2022.1-3 +- Update spec file comment + +* Sat Apr 16 2022 Benjamin A. Beasley 2022.1-2 +- Stop numbering patches + +* Wed Feb 16 2022 Benjamin A. Beasley 2022.1-1 +- Update to 2022.1 (close RHBZ#2053858) + +* Thu Jan 20 2022 Fedora Release Engineering 2021.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sat Nov 27 2021 Benjamin A. Beasley 2021.8-2 +- Reduce LaTeX PDF build verbosity + +* Thu Oct 21 2021 Benjamin A. Beasley 2021.8-1 +- Update to 2021.8 (close RHBZ#2016447) + +* Thu Oct 21 2021 Benjamin A. Beasley 2021.7-5 +- Reduce macro indirection in the spec file + +* Wed Sep 29 2021 Benjamin A. Beasley 2021.7-4 +- Improve comments about test availability + +* Mon Sep 27 2021 Benjamin A. Beasley 2021.7-3 +- Build PDF docs instead of HTML + +* Sun Sep 12 2021 Benjamin A. Beasley 2021.7-2 +- Drop BR on pyproject-rpm-macros, now implied by python3-devel + +* Mon Aug 16 2021 Benjamin A. Beasley 2021.7-1 +- Update to 2021.7 + +* Thu Jul 22 2021 Fedora Release Engineering 2021.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 25 2021 Benjamin A. Beasley - 2021.6-1 +- Initial package +