]> git.saurik.com Git - apt.git/blame - buildlib/po4a_manpage.mak
no-change bump of Standards-Version to 3.9.8
[apt.git] / buildlib / po4a_manpage.mak
CommitLineData
b01390ea
DK
1# -*- make -*-
2
3# This handles man pages with po4a. We convert to the respective
4# output in the source directory then copy over to the final dest. This
5# means po4a is only needed if compiling from bzr
6
7# Input
8# $(LC) - The language code of the translation
9
10# See defaults.mak for information about LOCAL
11
12# generate a list of accepted man page translations
13SOURCE = $(patsubst %.xml,%,$(wildcard *.$(LC).?.xml))
694ef56e 14INCLUDES = apt.ent apt-verbatim.ent apt-vendor.ent
b01390ea 15
1098ae37
DK
16manpages:
17
a034d852
GJ
18%.xsl: ../%.xsl
19 cp -a $< .
20
b01390ea
DK
21# Do not use XMLTO, build the manpages directly with XSLTPROC
22ifdef XSLTPROC
23
1c8754c2 24STYLESHEET=manpage-style.xsl
b01390ea
DK
25
26LOCAL := po4a-manpage-$(firstword $(SOURCE))
27$(LOCAL)-LIST := $(SOURCE)
28
29# Install generation hooks
1098ae37 30manpages: $($(LOCAL)-LIST)
ac62eb38 31clean: clean/$(LOCAL)
b01390ea
DK
32veryclean: veryclean/$(LOCAL)
33
0c1a7101 34apt-verbatim.ent: ../apt-verbatim.ent
694ef56e
DK
35 cp -a ../apt-verbatim.ent .
36
37apt-vendor.ent: ../apt-vendor.ent
38 cp -a ../apt-vendor.ent .
0c1a7101 39
75f37d7d 40$($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES)
b01390ea 41 echo Creating man page $@
05ccc2a5
GJ
42 $(XSLTPROC) \
43 --stringparam l10n.gentext.default.language $(LC) \
44 -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
ac62eb38 45 test -f $(subst .$(LC),,$@) || echo 'FIXME: xsltproc respects the -o flag now, workaround can be removed'
b01390ea
DK
46 mv -f $(subst .$(LC),,$@) $@
47
48# Clean rule
ac62eb38
DK
49.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
50clean/$(LOCAL):
51 rm -f $($(@F)-LIST) apt.ent apt-verbatim.ent
b01390ea 52veryclean/$(LOCAL):
ac62eb38 53 # we are nuking the directory we are working in as it is auto-generated
85a67355 54 rm -rf '$(abspath .)'
b01390ea
DK
55
56HAVE_PO4A=yes
57endif
58
59# take care of the rest
b01390ea
DK
60INCLUDES :=
61
62ifndef HAVE_PO4A
3a8776a3 63# Strip from the source list any man pages we don't have compiled already
b01390ea
DK
64SOURCE := $(wildcard $(SOURCE))
65endif
66
67# Chain to the manpage rule
68ifneq ($(words $(SOURCE)),0)
69include $(MANPAGE_H)
70endif
7652e03e 71
a034d852
GJ
72# DocBook XML Documents
73SOURCE := $(wildcard *.$(LC).dbk)
74include $(DOCBOOK_H)