]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
man: build the scdoc based man pages
authorEmil Velikov <emil.l.velikov@gmail.com>
Tue, 11 Jun 2024 15:05:03 +0000 (16:05 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 3 Jul 2024 15:14:35 +0000 (10:14 -0500)
Note that scdoc does not handle natively handle the dummy
modules.dep.bin.5 entry, so we need to create one manually.

Not a big deal, since it's single static line anyway.

Also: pkg-config --variable=scdoc scdoc, produces the full executable
and path, although for now we stick with the AC_PATH_PROG approach.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
[ Do not add the stub man page (modules.dep.bin.5) to CLEANFILES
  to avoid removing a file that is tracked by git. Also fix a typo
  s/AM_V_SCDOR_/AM_V_SCDOC_/ to make silent rules to work ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
configure.ac
man/Makefile.am
man/modules.dep.bin.5 [new file with mode: 0644]

index 9527aa2a418bfd8e8b9fd0b6ecfddc0e7ccb7d76..dcf7479b25890f8999bfadb8ad580791b746cdaf 100644 (file)
@@ -32,7 +32,7 @@ AC_PROG_SED
 AC_PROG_MKDIR_P
 AC_PROG_LN_S
 PKG_PROG_PKG_CONFIG
-AC_PATH_PROG([XSLTPROC], [xsltproc])
+AC_PATH_PROG([SCDOC], [scdoc])
 
 AC_PROG_CC_C99
 
index d62ff21c799ff734d2392ae76d147080f807b17b..77a0035755c281351ceea749deae06859ebd0e28 100644 (file)
@@ -2,37 +2,29 @@ MAN5 = depmod.d.5 modprobe.d.5 modules.dep.5
 MAN8 = kmod.8 depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
 MAN_STUB = modules.dep.bin.5
 
-AM_V_XSLT = $(AM_V_XSLT_$(V))
-AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
-AM_V_XSLT_0 = @echo "  XSLT    " $@;
-
-XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
+AM_V_SCDOC = $(AM_V_SCDOC_$(V))
+AM_V_SCDOC_ = $(AM_V_SCDOC_$(AM_DEFAULT_VERBOSITY))
+AM_V_SCDOC_0 = @echo "  SCDOC    " $@;
 
 if BUILD_TOOLS
 dist_man_MANS = $(MAN5) $(MAN8) $(MAN_STUB)
-modules.dep.bin.5: modules.dep.5
 endif
 
-EXTRA_DIST = $(MAN5:%.5=%.5.xml) $(MAN8:%.8=%.8.xml)
-CLEANFILES = $(dist_man_MANS)
+EXTRA_DIST = $(MAN5:%.5=%.5.scd) $(MAN8:%.8=%.8.scd)
+CLEANFILES = $(filter-out $(MAN_STUB), $(dist_man_MANS))
 
 define generate_manpage
-       $(AM_V_XSLT)if [ '$(distconfdir)' != '/lib' ] ; then \
+       $(AM_V_SCDOC)if [ '$(distconfdir)' != '/lib' ] ; then \
                sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \
        else \
                sed -e '/@DISTCONFDIR@/d' $< ; \
        fi | \
        sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
-       $(XSLT) \
-               -o $@ \
-               --nonet \
-               --stringparam man.output.quietly 1 \
-               --param funcsynopsis.style "'ansi'" \
-               http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -
+       $(SCDOC) > $@
 endef
 
-%.5: %.5.xml
+%.5: %.5.scd
        $(generate_manpage)
 
-%.8: %.8.xml
+%.8: %.8.scd
        $(generate_manpage)
diff --git a/man/modules.dep.bin.5 b/man/modules.dep.bin.5
new file mode 100644 (file)
index 0000000..795636b
--- /dev/null
@@ -0,0 +1 @@
+.so modules.dep.5