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