# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2013 Zbigniew Jędrzejewski-Szmek
#
# 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/>.
import collections
import sys
from xml_helper import *
SECTION = '''\
MANPAGES += \\
{manpages}
MANPAGES_ALIAS += \\
{aliases}
{rules}
{htmlrules}
'''
CONDITIONAL = '''\
if {conditional}
''' \
+ SECTION + \
'''\
endif
'''
HEADER = '''\
# Do not edit. Generated by make-man-rules.py.
# To regenerate:
# 1. Create, update, or remove source .xml files in man/
# 2. Run 'make update-man-list'
# 3. Run 'make man' to generate manpages
#
# To make a man page conditional on a configure switch add
# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
# to <refentry> element.
'''
HTML_ALIAS_RULE = '''\
{}.html: {}.html
$(html-alias)
'''
FOOTER = '''\
# Really, do not edit this file.
EXTRA_DIST += \\
{dist_files}
'''
# print('parsing {}'.format(name), file=sys.stderr)
return
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
" {conditional => {alias-name => source-name}} "
try:
except Exception:
raise
return rules
if k != v),
if k != v),
if __name__ == '__main__':