]> git.saurik.com Git - apt.git/blob - buildlib/po4a_manpage.mak
fix SHA2* cleanups to zero-out the complete context
[apt.git] / buildlib / po4a_manpage.mak
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
13 SOURCE = $(patsubst %.xml,%,$(wildcard *.$(LC).?.xml))
14 INCLUDES = apt.ent apt-verbatim.ent
15
16 manpages:
17
18 # Do not use XMLTO, build the manpages directly with XSLTPROC
19 ifdef XSLTPROC
20
21 STYLESHEET=manpage-style.xsl
22
23 LOCAL := po4a-manpage-$(firstword $(SOURCE))
24 $(LOCAL)-LIST := $(SOURCE)
25
26 # Install generation hooks
27 manpages: $($(LOCAL)-LIST)
28 clean: clean/$(LOCAL)
29 veryclean: veryclean/$(LOCAL)
30
31 apt-verbatim.ent: ../apt-verbatim.ent
32 cp ../apt-verbatim.ent .
33
34 manpage-style.xsl: ../manpage-style.xsl
35 sed "/<!-- LANGUAGE -->/ i\
36 <xsl:param name=\"l10n.gentext.default.language\" select=\"'$(LC)'\" />" ../manpage-style.xsl > manpage-style.xsl
37
38 $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES)
39 echo Creating man page $@
40 $(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
41 test -f $(subst .$(LC),,$@) || echo 'FIXME: xsltproc respects the -o flag now, workaround can be removed'
42 mv -f $(subst .$(LC),,$@) $@
43
44 # Clean rule
45 .PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
46 clean/$(LOCAL):
47 rm -f $($(@F)-LIST) apt.ent apt-verbatim.ent
48 veryclean/$(LOCAL):
49 # we are nuking the directory we are working in as it is auto-generated
50 rm -rf $(shell readlink -f .)
51
52 HAVE_PO4A=yes
53 endif
54
55 # take care of the rest
56 SOURCE := $(SOURCE) $(wildcard apt.$(LC).8)
57 INCLUDES :=
58
59 ifndef HAVE_PO4A
60 # Strip from the source list any man pages we dont have compiled already
61 SOURCE := $(wildcard $(SOURCE))
62 endif
63
64 # Chain to the manpage rule
65 ifneq ($(words $(SOURCE)),0)
66 include $(MANPAGE_H)
67 endif
68
69 # Debian Doc SGML Documents
70 SOURCE := $(wildcard *.$(LC).sgml)
71 DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8
72 include $(DEBIANDOC_H)