summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/Makefile.each.tail/70-sdman.mk4
-rw-r--r--build-aux/Makefile.once.head/20-sdman.mk16
-rw-r--r--src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml2
-rw-r--r--src/grp-system/systemd-shutdown/systemd-shutdown.xml2
-rwxr-xr-xtools/make-directive-index.py1
-rwxr-xr-xtools/make-man-index.py1
-rwxr-xr-x[-rw-r--r--]tools/make-man-rules.py14
-rw-r--r--tools/xml_helper.py10
8 files changed, 39 insertions, 11 deletions
diff --git a/build-aux/Makefile.each.tail/70-sdman.mk b/build-aux/Makefile.each.tail/70-sdman.mk
index ccbb1bd4e1..fa490a8677 100644
--- a/build-aux/Makefile.each.tail/70-sdman.mk
+++ b/build-aux/Makefile.each.tail/70-sdman.mk
@@ -26,12 +26,12 @@ _sdman.man_xml = $(foreach _sdman.tmp,$(filter %.xml,$(files.src.src)),$(if $(fi
ifneq ($(_sdman.man_xml),)
$(srcdir)/Makefile-man.mk: $(topsrcdir)/tools/make-man-rules.py $(topsrcdir)/tools/xml_helper.py $(topsrcdir)/man/custom-entities.ent.in $(outdir)/.var._sdman.man_xml $(call at.addprefix,$(srcdir),$(_sdman.man_xml))
- $(AM_V_GEN)$(PYTHON) $< $(filter %.xml,$^) | $(WRITE_ATOMIC) $@
+ $(AM_V_GEN)$< $(filter %.xml,$^) | $(WRITE_ATOMIC) $@
files.src.gen += Makefile-man.mk
sdman.MANPAGES =
sdman.MANPAGES_ALIAS =
-#-include $(srcdir)/Makefile-man.mk
+-include $(srcdir)/Makefile-man.mk
_sdman.XML_FILES = \
${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(sdman.MANPAGES)}}}}}
diff --git a/build-aux/Makefile.once.head/20-sdman.mk b/build-aux/Makefile.once.head/20-sdman.mk
index 558c60531d..bef7717511 100644
--- a/build-aux/Makefile.once.head/20-sdman.mk
+++ b/build-aux/Makefile.once.head/20-sdman.mk
@@ -67,6 +67,11 @@ AM_V_LN_ ?= $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
AM_V_LN_0 ?= @echo " LN " $@;
AM_V_LN_1 ?=
+AM_V_SOELIM ?= $(AM_V_SOELIM_$(V))
+AM_V_SOELIM_ ?= $(AM_V_SOELIM_$(AM_DEFAULT_VERBOSITY))
+AM_V_SOELIM_0 ?= @echo " SOELIM " $@;
+AM_V_SOELIM_1 ?=
+
AM_V_XSLT ?= $(AM_V_XSLT_$(V))
AM_V_XSLT_ ?= $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
AM_V_XSLT_0 ?= @echo " XSLT " $@;
@@ -89,5 +94,14 @@ _sdman.XSLTPROC_PROCESS_MAN = \
_sdman.XSLTPROC_PROCESS_HTML = \
$(AM_V_XSLT)$(_sdman.XSLT) -o $@ $(_sdman.XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
+# Because the docbooc-xsl authors are assholes, they ignore everything but the
+# directory of '-o' and instead choose filenames in it based on <refname>
+# elements, with no option to override that from the command line. This is a
+# nice feature, until we have to rectify it with Make's poor support for
+# commands with multiple outputs. So, we'll let it do its thing, but have a
+# rule for manually re-creating an alias without re-running xsltproc in case it
+# gets removed.
+sdman.man-alias = \
+ $(AM_V_LN)$(PRINTF) '.so %s\n' $(<F) > $@
sdman.html-alias = \
- $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
+ $(AM_V_LN)$(LN_S) -f $(<F) $@
diff --git a/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml b/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
index efd97eb671..c7b562915e 100644
--- a/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
+++ b/src/grp-initprogs/grp-sleep/systemd-sleep/systemd-sleep.xml
@@ -45,10 +45,10 @@
</refmeta>
<refnamediv>
+ <refname>systemd-sleep</refname>
<refname>systemd-suspend.service</refname>
<refname>systemd-hibernate.service</refname>
<refname>systemd-hybrid-sleep.service</refname>
- <refname>systemd-sleep</refname>
<refpurpose>System sleep state logic</refpurpose>
</refnamediv>
diff --git a/src/grp-system/systemd-shutdown/systemd-shutdown.xml b/src/grp-system/systemd-shutdown/systemd-shutdown.xml
index b1d1f87ce9..536f392d46 100644
--- a/src/grp-system/systemd-shutdown/systemd-shutdown.xml
+++ b/src/grp-system/systemd-shutdown/systemd-shutdown.xml
@@ -43,11 +43,11 @@
</refmeta>
<refnamediv>
+ <refname>systemd-shutdown</refname>
<refname>systemd-halt.service</refname>
<refname>systemd-poweroff.service</refname>
<refname>systemd-reboot.service</refname>
<refname>systemd-kexec.service</refname>
- <refname>systemd-shutdown</refname>
<refpurpose>System shutdown logic</refpurpose>
</refnamediv>
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py
index 256ff3dc5d..1b287997fa 100755
--- a/tools/make-directive-index.py
+++ b/tools/make-directive-index.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
diff --git a/tools/make-man-index.py b/tools/make-man-index.py
index 74a47b821a..abc33e7394 100755
--- a/tools/make-man-index.py
+++ b/tools/make-man-index.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py
index 0b73ab04f7..1913d44c65 100644..100755
--- a/tools/make-man-rules.py
+++ b/tools/make-man-rules.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
@@ -52,8 +53,13 @@ HEADER = '''\
# to <refentry> element.
'''
+MAN_ALIAS_RULE = '''\
+$(outdir)/{}: $(outdir)/{}
+ $(sdman.man-alias)
+'''
+
HTML_ALIAS_RULE = '''\
-{}.html: {}.html
+$(outdir)/{}.html: $(outdir)/{}.html
$(sdman.html-alias)
'''
@@ -66,10 +72,10 @@ EXTRA_DIST += \\
'''
def man(page, number):
- return 'man/{}.{}'.format(page, number)
+ return '{}.{}'.format(page, number)
def xml(file):
- return 'man/{}'.format(os.path.basename(file))
+ return '{}'.format(os.path.basename(file))
def add_rules(rules, name):
xml = xml_parse(name)
@@ -111,7 +117,7 @@ def make_makefile(rules, dist_files):
(CONDITIONAL if conditional else SECTION).format(
manpages=mjoin(set(rulegroup.values())),
aliases=mjoin(k for k,v in rulegroup.items() if k != v),
- rules='\n'.join('{}: {}'.format(k,v)
+ rules='\n'.join(MAN_ALIAS_RULE.format(k,v)
for k,v in sorted(rulegroup.items())
if k != v),
htmlrules='\n'.join(HTML_ALIAS_RULE.format(k[:-2],v[:-2])
diff --git a/tools/xml_helper.py b/tools/xml_helper.py
index e87126f2f7..07353847ba 100644
--- a/tools/xml_helper.py
+++ b/tools/xml_helper.py
@@ -18,11 +18,17 @@
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
from lxml import etree as tree
+import os.path
class CustomResolver(tree.Resolver):
def resolve(self, url, id, context):
- if 'custom-entities.ent' in url:
- return self.resolve_filename('man/custom-entities.ent', context)
+ if not os.path.exists(url):
+ srcdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ basename = os.path.basename(url)
+ if basename == 'custom-entities.ent':
+ basename = 'custom-entities.ent.in'
+ url = os.path.join(srcdir, 'man', basename)
+ return self.resolve_filename(url, context)
_parser = tree.XMLParser()
_parser.resolvers.add(CustomResolver())