]> git.saurik.com Git - apt.git/blame_incremental - buildlib/po4a_manpage.mak
debian/apt-doc.docs: remove README.MultiArch
[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 apt-vendor.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)
28clean: clean/$(LOCAL)
29veryclean: veryclean/$(LOCAL)
30
31apt-verbatim.ent: ../apt-verbatim.ent
32 cp -a ../apt-verbatim.ent .
33
34apt-vendor.ent: ../apt-vendor.ent
35 cp -a ../apt-vendor.ent .
36
37manpage-style.xsl: ../manpage-style.xsl
38 sed "/<!-- LANGUAGE -->/ i\
39<xsl:param name=\"l10n.gentext.default.language\" select=\"'$(LC)'\" />" ../manpage-style.xsl > manpage-style.xsl
40
41$($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES)
42 echo Creating man page $@
43 $(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
44 test -f $(subst .$(LC),,$@) || echo 'FIXME: xsltproc respects the -o flag now, workaround can be removed'
45 mv -f $(subst .$(LC),,$@) $@
46
47# Clean rule
48.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
49clean/$(LOCAL):
50 rm -f $($(@F)-LIST) apt.ent apt-verbatim.ent
51veryclean/$(LOCAL):
52 # we are nuking the directory we are working in as it is auto-generated
53 rm -rf $(shell readlink -f .)
54
55HAVE_PO4A=yes
56endif
57
58# take care of the rest
59SOURCE := $(SOURCE) $(wildcard apt.$(LC).8)
60INCLUDES :=
61
62ifndef HAVE_PO4A
63# Strip from the source list any man pages we dont have compiled already
64SOURCE := $(wildcard $(SOURCE))
65endif
66
67# Chain to the manpage rule
68ifneq ($(words $(SOURCE)),0)
69include $(MANPAGE_H)
70endif
71
72# Debian Doc SGML Documents
73SOURCE := $(wildcard *.$(LC).sgml)
74DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8
75include $(DEBIANDOC_H)