summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-05 10:31:20 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-06 23:16:17 -0500
commitc78ab91132aab9193f3c17a9a206f8825ff4be84 (patch)
tree5844ab1f9f3652e9fa5a894b898c5108270cda89
parent7ad94c716d6403233d04c4d37cb14df958c9b65d (diff)
build-sys: substitute strings in systemd.unit(5)
Makefile.am is updated to deal with .xml.in sources. Nothing in the output is really changed yet, this is just preparation.
-rw-r--r--Makefile-man.am3
-rw-r--r--Makefile.am2
-rw-r--r--make-man-rules.py18
-rw-r--r--man/.gitignore1
-rw-r--r--man/systemd.unit.xml.in (renamed from man/systemd.unit.xml)0
5 files changed, 19 insertions, 5 deletions
diff --git a/Makefile-man.am b/Makefile-man.am
index d54d67cf11..ee9a952765 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -477,3 +477,6 @@ MANPAGES_ALIAS += \
#
endif
+
+CLEANFILES += \
+ man/systemd.unit.xml
diff --git a/Makefile.am b/Makefile.am
index f73e8a6e74..6e5f5af9ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -503,7 +503,7 @@ CLEANFILES += \
if HAVE_PYTHON
NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
-XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
+XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_srcdir)/man/*.xml.in)
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
diff --git a/make-man-rules.py b/make-man-rules.py
index b88b43ac3d..9c50c8dec2 100644
--- a/make-man-rules.py
+++ b/make-man-rules.py
@@ -44,6 +44,12 @@ HEADER = '''\
'''
+CLEANFILES = '''\
+
+CLEANFILES += \\
+ {cleanfiles}
+'''
+
def man(page, number):
return 'man/{}.{}'.format(page, number)
@@ -76,7 +82,7 @@ def create_rules(*xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules):
+def make_makefile(rules, cleanfiles):
return HEADER + '\n'.join(
(CONDITIONAL if conditional else SECTION).format(
manpages=mjoin(set(rulegroup.values())),
@@ -85,8 +91,12 @@ 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())) + \
+ CLEANFILES.format(cleanfiles=mjoin(cleanfiles))
if __name__ == '__main__':
- rules = create_rules(*sys.argv[1:])
- print(make_makefile(rules), end='')
+ sources = set(sys.argv[1:])
+ spares = set([source for source in sources
+ if source + '.in' in sources])
+ rules = create_rules(*(sources - spares))
+ print(make_makefile(rules, spares), end='')
diff --git a/man/.gitignore b/man/.gitignore
index 9c5a7db1cc..18767949c1 100644
--- a/man/.gitignore
+++ b/man/.gitignore
@@ -1,3 +1,4 @@
/systemd.directives.xml
/systemd.index.xml
+/systemd.unit.xml
/*.[13578]
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml.in
index 7c3a6c75f8..7c3a6c75f8 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml.in