build-sys: add xml sources to EXTRA_DIST

Apparently automake does not include the sources if they are under
a conditional that is disabled when making dist. This means that
everything would have to be enabled to make distcheck work.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-12-21 18:11:35 -05:00
parent 2dc38ed00f
commit 40be878abb
2 changed files with 167 additions and 5 deletions

View File

@ -1056,3 +1056,153 @@ MANPAGES_ALIAS += \
endif
EXTRA_DIST += \
man/binfmt.d.xml \
man/bootchart.conf.xml \
man/bootctl.xml \
man/bootup.xml \
man/crypttab.xml \
man/daemon.xml \
man/halt.xml \
man/hostname.xml \
man/hostnamectl.xml \
man/journalctl.xml \
man/journald.conf.xml \
man/kernel-command-line.xml \
man/kernel-install.xml \
man/locale.conf.xml \
man/localectl.xml \
man/localtime.xml \
man/loginctl.xml \
man/logind.conf.xml \
man/machine-id.xml \
man/machine-info.xml \
man/machinectl.xml \
man/modules-load.d.xml \
man/nss-myhostname.xml \
man/os-release.xml \
man/pam_systemd.xml \
man/runlevel.xml \
man/sd-daemon.xml \
man/sd-id128.xml \
man/sd-journal.xml \
man/sd-login.xml \
man/sd-readahead.xml \
man/sd_booted.xml \
man/sd_bus_request_name.xml \
man/sd_get_seats.xml \
man/sd_id128_get_machine.xml \
man/sd_id128_randomize.xml \
man/sd_id128_to_string.xml \
man/sd_is_fifo.xml \
man/sd_journal_add_match.xml \
man/sd_journal_get_catalog.xml \
man/sd_journal_get_cursor.xml \
man/sd_journal_get_cutoff_realtime_usec.xml \
man/sd_journal_get_data.xml \
man/sd_journal_get_fd.xml \
man/sd_journal_get_realtime_usec.xml \
man/sd_journal_get_usage.xml \
man/sd_journal_next.xml \
man/sd_journal_open.xml \
man/sd_journal_print.xml \
man/sd_journal_query_unique.xml \
man/sd_journal_seek_head.xml \
man/sd_journal_stream_fd.xml \
man/sd_listen_fds.xml \
man/sd_login_monitor_new.xml \
man/sd_notify.xml \
man/sd_pid_get_session.xml \
man/sd_readahead.xml \
man/sd_seat_get_active.xml \
man/sd_session_is_active.xml \
man/sd_uid_get_state.xml \
man/shutdown.xml \
man/sysctl.d.xml \
man/systemctl.xml \
man/systemd-activate.xml \
man/systemd-analyze.xml \
man/systemd-ask-password-console.service.xml \
man/systemd-ask-password.xml \
man/systemd-backlight@.service.xml \
man/systemd-binfmt.service.xml \
man/systemd-bootchart.xml \
man/systemd-bus-proxyd.xml \
man/systemd-bus-proxyd@.service.xml \
man/systemd-cat.xml \
man/systemd-cgls.xml \
man/systemd-cgtop.xml \
man/systemd-coredumpctl.xml \
man/systemd-cryptsetup-generator.xml \
man/systemd-cryptsetup@.service.xml \
man/systemd-delta.xml \
man/systemd-detect-virt.xml \
man/systemd-efi-boot-generator.xml \
man/systemd-fsck@.service.xml \
man/systemd-fstab-generator.xml \
man/systemd-getty-generator.xml \
man/systemd-gpt-auto-generator.xml \
man/systemd-halt.service.xml \
man/systemd-hostnamed.service.xml \
man/systemd-inhibit.xml \
man/systemd-initctl.service.xml \
man/systemd-journal-gatewayd.service.xml \
man/systemd-journald.service.xml \
man/systemd-localed.service.xml \
man/systemd-logind.service.xml \
man/systemd-machine-id-setup.xml \
man/systemd-machined.service.xml \
man/systemd-modules-load.service.xml \
man/systemd-networkd.service.xml \
man/systemd-notify.xml \
man/systemd-nspawn.xml \
man/systemd-quotacheck.service.xml \
man/systemd-random-seed.service.xml \
man/systemd-readahead-replay.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-rfkill@.service.xml \
man/systemd-run.xml \
man/systemd-shutdownd.service.xml \
man/systemd-sleep.conf.xml \
man/systemd-socket-proxyd.xml \
man/systemd-suspend.service.xml \
man/systemd-sysctl.service.xml \
man/systemd-system-update-generator.xml \
man/systemd-system.conf.xml \
man/systemd-timedated.service.xml \
man/systemd-tmpfiles.xml \
man/systemd-tty-ask-password-agent.xml \
man/systemd-udevd.service.xml \
man/systemd-update-utmp.service.xml \
man/systemd-user-sessions.service.xml \
man/systemd-vconsole-setup.service.xml \
man/systemd.automount.xml \
man/systemd.device.xml \
man/systemd.directives.xml \
man/systemd.exec.xml \
man/systemd.index.xml \
man/systemd.journal-fields.xml \
man/systemd.kill.xml \
man/systemd.mount.xml \
man/systemd.path.xml \
man/systemd.preset.xml \
man/systemd.resource-control.xml \
man/systemd.scope.xml \
man/systemd.service.xml \
man/systemd.slice.xml \
man/systemd.snapshot.xml \
man/systemd.socket.xml \
man/systemd.special.xml \
man/systemd.swap.xml \
man/systemd.target.xml \
man/systemd.time.xml \
man/systemd.timer.xml \
man/systemd.unit.xml \
man/systemd.xml \
man/telinit.xml \
man/timedatectl.xml \
man/tmpfiles.d.xml \
man/udev.xml \
man/udevadm.xml \
man/vconsole.conf.xml

View File

@ -20,6 +20,7 @@
from __future__ import print_function
import collections
import sys
import os.path
from xml_helper import *
SECTION = '''\
@ -50,9 +51,18 @@ HTML_ALIAS_RULE = '''\
$(html-alias)
'''
FOOTER = '''\
EXTRA_DIST += \\
{files}
'''
def man(page, number):
return 'man/{}.{}'.format(page, number)
def xml(file):
return 'man/{}'.format(os.path.basename(file))
def add_rules(rules, name):
xml = xml_parse(name)
# print('parsing {}'.format(name), file=sys.stderr)
@ -72,7 +82,7 @@ def add_rules(rules, name):
rulegroup[alias] = target
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
def create_rules(*xml_files):
def create_rules(xml_files):
" {conditional => {alias-name => source-name}} "
rules = collections.defaultdict(dict)
for name in xml_files:
@ -82,7 +92,7 @@ def create_rules(*xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
def make_makefile(rules):
def make_makefile(rules, files):
return HEADER + '\n'.join(
(CONDITIONAL if conditional else SECTION).format(
manpages=mjoin(set(rulegroup.values())),
@ -94,8 +104,10 @@ def make_makefile(rules):
for k,v in sorted(rulegroup.items())
if k != v),
conditional=conditional)
for conditional,rulegroup in sorted(rules.items()))
for conditional,rulegroup in sorted(rules.items())
) + FOOTER.format(files=mjoin(sorted(files)))
if __name__ == '__main__':
rules = create_rules(*sys.argv[1:])
print(make_makefile(rules), end='')
rules = create_rules(sys.argv[1:])
files = (xml(file) for file in sys.argv[1:])
print(make_makefile(rules, files), end='')