Skip to content

Commit 5a641eb

Browse files
committed
doc: Prebundle docs on RHEL & CentOS
With this we can get rid of asciidoc-py dependency altogether and instead rely on the docs being prebundled before installation. Signed-off-by: Freya Gustavsson <[email protected]>
1 parent 6f741fb commit 5a641eb

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tools/cockpit.spec

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
%define rebuild_bundle 1
5757
%endif
5858

59+
# to avoid using asciidoc-py in RHEL and CentOS we prebuild it
60+
%if 0%{?rhel} || 0%{?centos}
61+
%define rebuild_docs 1
62+
%define docbundledir doc/output/html
63+
%endif
64+
5965
Name: cockpit
6066
Summary: Web Console for Linux servers
6167

@@ -117,11 +123,7 @@ BuildRequires: nodejs-esbuild
117123
%endif
118124

119125
# For documentation
120-
%if 0%{?rhel} || 0%{?centos}
121-
# Only has legacy asciidoc-py and not asciidoctor.
122-
# asciidoc-py includes a2x package which can generate man-pages.
123-
BuildRequires: asciidoc
124-
%else
126+
%if !%{defined rebuild_docs}
125127
BuildRequires: asciidoctor
126128
%endif
127129

@@ -187,6 +189,9 @@ NODE_ENV=production NODE_PATH=$(echo /usr/lib/node_modules_*) ./build.js
187189
%if %{enable_multihost}
188190
--enable-multihost \
189191
%endif
192+
%if %{defined rebuild_docs}
193+
--disable-doc \
194+
%endif
190195

191196
%make_build
192197

@@ -210,6 +215,10 @@ install -p -m 644 %{pamconfig} $RPM_BUILD_ROOT%{pamconfdir}/cockpit
210215
rm -f %{buildroot}/%{_libdir}/cockpit/*.so
211216
install -D -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/cockpit/
212217

218+
%if 0%{?rhel} || 0%{?centos}
219+
install -D -p -m 644 %{docbundledir} %{buildroot}%{_docdir}/cockpit/
220+
%endif
221+
213222
# Build the package lists for resource packages
214223
# cockpit-bridge is the basic dependency for all cockpit-* packages, so centrally own the page directory
215224
echo '%dir %{_datadir}/cockpit' > base.list
@@ -297,6 +306,7 @@ troubleshooting, interactive command-line sessions, and more.
297306
%{_docdir}/cockpit/AUTHORS
298307
%{_docdir}/cockpit/COPYING
299308
%{_docdir}/cockpit/README.md
309+
%{_docdir}/cockpit/*.html
300310
%{_datadir}/metainfo/org.cockpit_project.cockpit.appdata.xml
301311
%{_datadir}/icons/hicolor/128x128/apps/cockpit.png
302312
%doc %{_mandir}/man1/cockpit.1.gz
@@ -331,6 +341,7 @@ embed or extend Cockpit.
331341
%exclude %{_docdir}/cockpit/AUTHORS
332342
%exclude %{_docdir}/cockpit/COPYING
333343
%exclude %{_docdir}/cockpit/README.md
344+
%exclude %{_docdir}/cockpit/*.html
334345
%{_docdir}/cockpit
335346

336347
%package system

0 commit comments

Comments
 (0)