Skip to content

Commit 3674ecf

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 0929533 commit 3674ecf

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

doc/guide/Makefile-guide.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ GUIDE_PAGES_INST = \
142142

143143
noinst_DATA += $(GUIDE_PAGES_INST)
144144

145+
# Some distros don't have asciidoctor and we need to prebundle the docs, e.g. RHEL & CentOS
146+
EXTRA_DIST += $(GUIDE_PAGES_INST)
147+
145148
GUIDE_ASCIIDOC_ARGS = \
146149
-a cockpit-version=$(VERSION) \
147150
-a toc=left \

tools/cockpit.spec

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,9 @@ BuildRequires: nodejs
116116
BuildRequires: nodejs-esbuild
117117
%endif
118118

119-
# 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
119+
# to avoid using asciidoc-py in RHEL and CentOS we use the prebuilt docs
120+
%if 0%{?rhel}
121+
%define bundle_docs 1
124122
%else
125123
BuildRequires: asciidoctor
126124
%endif
@@ -187,6 +185,9 @@ NODE_ENV=production NODE_PATH=/usr/lib/node_modules:$(echo /usr/lib/node_modules
187185
%if %{enable_multihost}
188186
--enable-multihost \
189187
%endif
188+
%if %{defined bundle_docs}
189+
--disable-doc \
190+
%endif
190191

191192
%make_build
192193

@@ -210,6 +211,12 @@ install -p -m 644 %{pamconfig} $RPM_BUILD_ROOT%{pamconfdir}/cockpit
210211
rm -f %{buildroot}/%{_libdir}/cockpit/*.so
211212
install -D -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/cockpit/
212213

214+
# We install the upstream pre-built docs as we can't build them
215+
%if %{defined bundle_docs}
216+
%define docbundledir doc/output/html
217+
install -D -p -m 644 %{docbundledir} %{buildroot}%{_docdir}/cockpit/
218+
%endif
219+
213220
# Build the package lists for resource packages
214221
# cockpit-bridge is the basic dependency for all cockpit-* packages, so centrally own the page directory
215222
echo '%dir %{_datadir}/cockpit' > base.list

0 commit comments

Comments
 (0)