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+
5965Name: cockpit
6066Summary: 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 }
125127BuildRequires: 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
210215rm -f %{buildroot }/%{_libdir }/cockpit/*.so
211216install -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
215224echo '%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