+# Do not edit. Generated by make-man-rules.py.
+# Regenerate with 'make man-list-update'.
+
MANPAGES += \
man/bootup.7 \
man/daemon.7 \
MANPAGES += \
man/bootchart.conf.5 \
man/systemd-bootchart.1
+MANPAGES_ALIAS += \
+ #
+
endif
if ENABLE_HOSTNAMED
if HAVE_MYHOSTNAME
MANPAGES += \
man/nss-myhostname.8
+MANPAGES_ALIAS += \
+ #
+
endif
if HAVE_PAM
MANPAGES += \
man/systemd.directives.7 \
man/systemd.index.7
+MANPAGES_ALIAS += \
+ #
+
endif
if HAVE_PYTHON
NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
+
+XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
+update-man-list: make-man-rules.py $(XML_GLOB)
+ $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
+ $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
+ @echo "Makefile-man.am has been regenerated"
+
man/systemd.index.xml: make-man-index.py $(NON_INDEX_XML_FILES)
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(PYTHON) $^ > $@
import re
TEMPLATE = '''\
-<refentry id="systemd.directives">
+<refentry id="systemd.directives" conditional="HAVE_PYTHON">
<refentryinfo>
<title>systemd.directives</title>
MDASH = ' — ' if sys.version_info.major >= 3 else ' -- '
TEMPLATE = '''\
-<refentry id="systemd.index">
+<refentry id="systemd.index" conditional="HAVE_PYTHON">
<refentryinfo>
<title>systemd.index</title>
--- /dev/null
+# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
+#
+# This file is part of systemd.
+#
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import print_function
+import xml.etree.ElementTree as tree
+import collections
+import sys
+
+SECTION = '''\
+MANPAGES += \\
+ {manpages}
+MANPAGES_ALIAS += \\
+ {aliases}
+{rules}
+'''
+
+CONDITIONAL = '''\
+if {conditional}
+''' \
++ SECTION + \
+'''\
+endif
+'''
+
+HEADER = '''\
+# Do not edit. Generated by make-man-rules.py.
+# Regenerate with 'make update-man-list'.
+
+'''
+
+def man(page, number):
+ return 'man/{}.{}'.format(page, number)
+
+def add_rules(rules, name):
+ xml = tree.parse(name)
+ # print('parsing {}'.format(name), file=sys.stderr)
+ conditional = xml.getroot().get('conditional') or ''
+ rulegroup = rules[conditional]
+ refmeta = xml.find('./refmeta')
+ title = refmeta.find('./refentrytitle').text
+ number = refmeta.find('./manvolnum').text
+ refnames = xml.findall('./refnamediv/refname')
+ target = man(refnames[0].text, number)
+ if title != refnames[0].text:
+ raise ValueError('refmeta and refnamediv disagree: ' + name)
+ for refname in refnames:
+ assert all(refname not in group
+ for group in rules.values()), "duplicate page name"
+ alias = man(refname.text, number)
+ rulegroup[alias] = target
+ # print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
+
+def create_rules(*xml_files):
+ " {conditional => {alias-name => source-name}} "
+ rules = collections.defaultdict(dict)
+ for name in xml_files:
+ add_rules(rules, name)
+ return rules
+
+def mjoin(files):
+ return ' \\\n\t'.join(sorted(files) or '#')
+
+def make_makefile(rules):
+ return HEADER + '\n'.join(
+ (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)
+ for k,v in sorted(rulegroup.items())
+ if k != v),
+ conditional=conditional)
+ for conditional,rulegroup in sorted(rules.items()))
+
+if __name__ == '__main__':
+ rules = create_rules(*sys.argv[1:])
+ print(make_makefile(rules), end='')
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="binfmt.d">
+<refentry id="binfmt.d" conditional='ENABLE_BINFMT'>
<refentryinfo>
<title>binfmt.d</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="bootchart.conf">
+<refentry id="bootchart.conf" conditional='ENABLE_BOOTCHART'>
<refentryinfo>
<title>bootchart.conf</title>
<productname>systemd</productname>
The Red Hat version has been written by Miloslav Trmac <mitr@redhat.com>.
-->
-<refentry id="crypttab">
+<refentry id="crypttab" conditional='HAVE_LIBCRYPTSETUP'>
<refentryinfo>
<title>crypttab</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="hostnamectl">
+<refentry id="hostnamectl" conditional='ENABLE_HOSTNAMED'>
<refentryinfo>
<title>hostnamectl</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="localectl">
+<refentry id="localectl" conditional='ENABLE_LOCALED'>
<refentryinfo>
<title>localectl</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="loginctl">
+<refentry id="loginctl" conditional='HAVE_PAM'>
<refentryinfo>
<title>loginctl</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="logind.conf">
+<refentry id="logind.conf" conditional='HAVE_PAM'>
<refentryinfo>
<title>logind.conf</title>
<productname>systemd</productname>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="modules-load.d">
+<refentry id="modules-load.d" conditional='HAVE_KMOD'>
<refentryinfo>
<title>modules-load.d</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="nss-myhostname">
+<refentry id="nss-myhostname" conditional='HAVE_MYHOSTNAME'>
<refentryinfo>
<title>nss-myhostname</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd-login">
+<refentry id="sd-login" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd-login</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd-daemon">
+<refentry id="sd-daemon" conditional='ENABLE_READAHEAD'>
<refentryinfo>
<title>sd-readahead</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_get_seats">
+<refentry id="sd_get_seats" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_get_seats</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_login_monitor_new">
+<refentry id="sd_login_monitor_new" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_login_monitor_new</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_pid_get_session">
+<refentry id="sd_pid_get_session" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_pid_get_session</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_notify">
+<refentry id="sd_notify" conditional='ENABLE_READAHEAD'>
<refentryinfo>
<title>sd_readahead</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_seat_get_active">
+<refentry id="sd_seat_get_active" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_seat_get_active</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_session_is_active">
+<refentry id="sd_session_is_active" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_session_is_active</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="sd_uid_get_state">
+<refentry id="sd_uid_get_state" conditional='HAVE_PAM'>
<refentryinfo>
<title>sd_uid_get_state</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-binfmt.service">
+<refentry id="systemd-binfmt.service" conditional='ENABLE_BINFMT'>
<refentryinfo>
<title>systemd-binfmt.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-bootchart">
+<refentry id="systemd-bootchart" conditional='ENABLE_BOOTCHART'>
<refentryinfo>
<title>systemd-bootchart</title>
<productname>systemd</productname>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-cryptsetup-generator">
+<refentry id="systemd-cryptsetup-generator" conditional='HAVE_LIBCRYPTSETUP'>
<refentryinfo>
<title>systemd-cryptsetup-generator</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-cryptsetup@.service">
+<refentry id="systemd-cryptsetup@.service" conditional='HAVE_LIBCRYPTSETUP'>
<refentryinfo>
<title>systemd-cryptsetup@.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-hostnamed.service">
+<refentry id="systemd-hostnamed.service" conditional='ENABLE_HOSTNAMED'>
<refentryinfo>
<title>systemd-hostnamed.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-journal-gatewayd.service">
+<refentry id="systemd-journal-gatewayd.service" conditional='HAVE_MICROHTTPD'>
<refentryinfo>
<title>systemd-journal-gatewayd.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-localed.service">
+<refentry id="systemd-localed.service" conditional='ENABLE_LOCALED'>
<refentryinfo>
<title>systemd-localed.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-logind.service">
+<refentry id="systemd-logind.service" conditional='HAVE_PAM'>
<refentryinfo>
<title>systemd-logind.service</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-modules-load.service">
+<refentry id="systemd-modules-load.service" conditional='HAVE_KMOD'>
<refentryinfo>
<title>systemd-modules-load.service</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-quotacheck.service">
+<refentry id="systemd-quotacheck.service" conditional='ENABLE_QUOTACHECK'>
<refentryinfo>
<title>systemd-quotacheck.service</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-random-seed-load.service">
+<refentry id="systemd-random-seed-load.service" conditional='ENABLE_RANDOMSEED'>
<refentryinfo>
<title>systemd-random-seed-load.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-readahead-replay.service">
+<refentry id="systemd-readahead-replay.service" conditional='ENABLE_READAHEAD'>
<refentryinfo>
<title>systemd-readahead-replay.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-timedated.service">
+<refentry id="systemd-timedated.service" conditional='ENABLE_TIMEDATED'>
<refentryinfo>
<title>systemd-timedated.service</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-user-sessions.service">
+<refentry id="systemd-user-sessions.service" conditional='HAVE_PAM'>
<refentryinfo>
<title>systemd-user-sessions.service</title>
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="systemd-vconsole-setup.service">
+<refentry id="systemd-vconsole-setup.service" conditional='ENABLE_VCONSOLE'>
<refentryinfo>
<title>systemd-vconsole-setup.service</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="timedatectl">
+<refentry id="timedatectl" conditional='ENABLE_TIMEDATED'>
<refentryinfo>
<title>timedatectl</title>
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
-<refentry id="vconsole.conf">
+<refentry id="vconsole.conf" conditional='ENABLE_VCONSOLE'>
<refentryinfo>
<title>vconsole.conf</title>
<productname>systemd</productname>