]> git.saurik.com Git - apt.git/blame - buildlib/po4a_manpage.mak
always "delete d" in FileFd::~FileFd to coverity happy
[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))
0c1a7101 14INCLUDES = apt.ent apt-verbatim.ent
b01390ea 15
1098ae37
DK
16manpages:
17
b01390ea
DK
18# Do not use XMLTO, build the manpages directly with XSLTPROC
19ifdef XSLTPROC
20
1c8754c2 21STYLESHEET=manpage-style.xsl
b01390ea
DK
22
23LOCAL := po4a-manpage-$(firstword $(SOURCE))
24$(LOCAL)-LIST := $(SOURCE)
25
26# Install generation hooks
1098ae37 27manpages: $($(LOCAL)-LIST)
ac62eb38 28clean: clean/$(LOCAL)
b01390ea
DK
29veryclean: veryclean/$(LOCAL)
30
0c1a7101
DK
31apt-verbatim.ent: ../apt-verbatim.ent
32 cp ../apt-verbatim.ent .
33
75f37d7d
DK
34manpage-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)
b01390ea 39 echo Creating man page $@
b6d189ca 40 $(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
ac62eb38 41 test -f $(subst .$(LC),,$@) || echo 'FIXME: xsltproc respects the -o flag now, workaround can be removed'
b01390ea
DK
42 mv -f $(subst .$(LC),,$@) $@
43
44# Clean rule
ac62eb38
DK
45.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
46clean/$(LOCAL):
47 rm -f $($(@F)-LIST) apt.ent apt-verbatim.ent
b01390ea 48veryclean/$(LOCAL):
ac62eb38
DK
49 # we are nuking the directory we are working in as it is auto-generated
50 rm -rf $(shell readlink -f .)
b01390ea
DK
51
52HAVE_PO4A=yes
53endif
54
55# take care of the rest
7652e03e 56SOURCE := $(SOURCE) $(wildcard apt.$(LC).8)
b01390ea
DK
57INCLUDES :=
58
59ifndef HAVE_PO4A
60# Strip from the source list any man pages we dont have compiled already
61SOURCE := $(wildcard $(SOURCE))
62endif
63
64# Chain to the manpage rule
65ifneq ($(words $(SOURCE)),0)
66include $(MANPAGE_H)
67endif
7652e03e
DK
68
69# Debian Doc SGML Documents
70SOURCE := $(wildcard *.$(LC).sgml)
46e39c8e 71DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8
7652e03e 72include $(DEBIANDOC_H)