Skip to content

Commit 9d3a115

Browse files
committed
doc: Do not build modulemd-validator(1) with help2man
The manual page was not valid UTF-8. (An elipsis character in an usage text.) The problem was caused by help2man tool which produced ISO-8859-1 pages from UTF-8 "modulemd-validator --help" output. help2man does not expect UTF-8 in nonlocalized mode. But localized mode is not supported in Fedora for security reasons. Executing "modulemd-validator --help" in C locale would fix help2man but it would break Glib which prints a garbage in that locale. Moreover, the manual page being identical to the usage output does not brought any added value. Also the help2man output embeded a date which could differ among builds for various architectures. I fixed all the issues by writing the manual page by hand. Now the manual page is more verbose and more helpful. We also dropped a build-dependency on help2man. To preserve compatibility, meson's with_manpages option was not turned into a boolean. This can be done later when introducing large breaking changes. (-Dwith_manpages=enabled vs. -Dwith_manpages=true)
1 parent 9831cbc commit 9d3a115

File tree

11 files changed

+106
-43
lines changed

11 files changed

+106
-43
lines changed

.ci/archlinux/Dockerfile.deps.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ RUN pacman -Syu --needed --noconfirm \
99
glib2-docs \
1010
gobject-introspection \
1111
gtk-doc \
12-
help2man \
1312
jq \
1413
libyaml \
1514
meson \

.ci/centos/Dockerfile.deps.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ ifelse(eval(__RELEASE__ >= 8), 1, `dnl
1919
glib2-doc \
2020
gobject-introspection-devel \
2121
gtk-doc \
22-
help2man \
2322
jq \
2423
libyaml-devel \
2524
meson \

.ci/fedora/get_fedora_deps.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dnf -y --setopt=install_weak_deps=False --setopt=tsflags='' \
2424
glib2-doc \
2525
gobject-introspection-devel \
2626
gtk-doc \
27-
help2man \
2827
jq \
2928
libyaml-devel \
3029
meson \

.ci/mageia/Dockerfile.deps.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ RUN dnf -y --setopt=install_weak_deps=False --setopt=tsflags='' install \
1616
/usr/share/gtk-doc/html/glib/index.html \
1717
gobject-introspection-devel \
1818
gtk-doc \
19-
help2man \
2019
jq \
2120
libyaml-devel \
2221
meson \

.ci/openmandriva/Dockerfile.deps.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ RUN dnf -y --setopt=install_weak_deps=False --setopt=tsflags='' install \
66
clang \
77
clang-analyzer \
88
cmake \
9-
help2man \
109
jq \
1110
meson \
1211
ninja \

.ci/opensuse/Dockerfile.deps.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RUN zypper install --no-confirm --no-recommends --capability \
1717
glib2-devel \
1818
gobject-introspection-devel \
1919
gtk-doc \
20-
help2man \
2120
jq \
2221
libyaml-devel \
2322
meson \

.github/workflows/ci.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ jobs:
259259
run: cp /etc/pacman.conf.pacnew /etc/pacman.conf
260260

261261
- name: Install dependencies
262-
run: pacman -Syu --needed --noconfirm base-devel file git glib2 glib2-docs gobject-introspection gtk-doc help2man jq libyaml meson python-gobject python2-six valgrind
262+
run: pacman -Syu --needed --noconfirm base-devel file git glib2 glib2-docs gobject-introspection gtk-doc jq libyaml meson python-gobject python2-six valgrind
263263

264264
- name: Checkout code
265265
uses: actions/checkout@v2
@@ -313,7 +313,6 @@ jobs:
313313
/usr/share/gtk-doc/html/glib/index.html
314314
gobject-introspection-devel
315315
gtk-doc
316-
help2man
317316
jq
318317
libyaml-devel
319318
meson
@@ -394,7 +393,6 @@ jobs:
394393
glib2-devel
395394
gobject-introspection-devel
396395
gtk-doc
397-
help2man
398396
jq
399397
libyaml-devel
400398
meson
@@ -456,7 +454,6 @@ jobs:
456454
clang
457455
clang-analyzer
458456
cmake
459-
help2man
460457
jq
461458
meson
462459
ninja

fedora/libmodulemd.spec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ BuildRequires: python-gobject-base
4141
%endif
4242
BuildRequires: python%{python3_pkgversion}-devel
4343
BuildRequires: python%{python3_pkgversion}-gobject-base
44-
BuildRequires: help2man
4544

4645

4746
# Patches

meson.build

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ if with_docs
8080
endif
8181
endif
8282

83-
with_manpages = get_option('with_manpages')
84-
help2man = find_program('help2man', required: with_manpages)
85-
if not help2man.found()
86-
help2man = disabler()
83+
# Keep with_manpages option a tristate feature for backward compatibility.
84+
if get_option('with_manpages').disabled()
85+
with_manpages = false
86+
else
87+
with_manpages = true
8788
endif
8889

8990
# Check whether this version of glib has the GDate autoptr defined
@@ -186,22 +187,10 @@ if meson.version().version_compare('>=0.53')
186187
endif
187188
endif
188189

189-
if help2man.found()
190-
if with_manpages.enabled()
191-
manpages_status = 'Enabled'
192-
elif with_manpages.auto()
193-
manpages_status = 'Enabled (autodetected)'
194-
else
195-
error('manpages state is unknown')
196-
endif
190+
if with_manpages
191+
manpages_status = 'Enabled'
197192
else
198-
if with_manpages.disabled()
199-
manpages_status = 'Disabled'
200-
elif with_rpmio.auto()
201-
manpages_status = 'Disabled (autodetection could not locate help2man)'
202-
else
203-
error('manpages state is unknown')
204-
endif
193+
manpages_status = 'Disabled'
205194
endif
206195

207196
summary({'prefix': get_option('prefix'),
@@ -215,7 +204,7 @@ if meson.version().version_compare('>=0.53')
215204
summary({'libmagic Support': magic_status,
216205
'Custom Python': get_option('python_name'),
217206
'RPMIO Support': rpmio_status,
218-
'Generate Manpages': manpages_status,
207+
'Generate Manual Pages': manpages_status,
219208
'Generate HTML Documentation': get_option('with_docs'),
220209
'Python 2 Support': get_option('with_py2'),
221210
'Python 3 Support': get_option('with_py3'),

modulemd/meson.build

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ configure_file(
255255
configuration : xcdata
256256
)
257257

258+
259+
# --- Documenatation --- #
260+
258261
if with_docs
259262
gnome.gtkdoc(
260263
'modulemd-2.0',
@@ -273,18 +276,9 @@ if with_docs
273276
)
274277
endif
275278

276-
help2man_opts = [
277-
'--no-info',
278-
'--section=1',
279-
]
280-
custom_target(
281-
'modulemd-validator.1',
282-
output: 'modulemd-validator.1',
283-
command: [
284-
help2man, help2man_opts, '--output=@OUTPUT@', modulemd_validator,
285-
],
286-
install: true,
287-
install_dir: join_paths(get_option('mandir'), 'man1'))
279+
if with_manpages
280+
install_man('modulemd-validator.1')
281+
endif
288282

289283

290284
# --- TESTS --- #

0 commit comments

Comments
 (0)