]> git.saurik.com Git - apt.git/blame - buildlib/po4a_manpage.mak
origin can be used to match a hostname (Closes: #352667)
[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))
14INCLUDES = apt.ent
15
16# Do not use XMLTO, build the manpages directly with XSLTPROC
17ifdef XSLTPROC
18
bcf91c1b 19STYLESHEET=../manpage-style.xsl
b01390ea
DK
20
21LOCAL := po4a-manpage-$(firstword $(SOURCE))
22$(LOCAL)-LIST := $(SOURCE)
23
24# Install generation hooks
25doc: $($(LOCAL)-LIST)
26veryclean: veryclean/$(LOCAL)
27
28$($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
29 echo Creating man page $@
30 $(XSLTPROC) -o $@ $(STYLESHEET) $< # why xsltproc doesn't respect the -o flag here???
9cdb1aab 31 test -f $(subst .$(LC),,$@) || echo FIXME: xsltproc respect the -o flag now, workaround can be removed
b01390ea
DK
32 mv -f $(subst .$(LC),,$@) $@
33
34# Clean rule
35.PHONY: veryclean/$(LOCAL)
36veryclean/$(LOCAL):
37 -rm -rf $($(@F)-LIST) apt.ent apt.$(LC).8 \
93517da3
DK
38 $(addsuffix .xml,$($(@F)-LIST)) \
39 offline.$(LC).sgml guide.$(LC).sgml
b01390ea
DK
40
41HAVE_PO4A=yes
42endif
43
44# take care of the rest
7652e03e 45SOURCE := $(SOURCE) $(wildcard apt.$(LC).8)
b01390ea
DK
46INCLUDES :=
47
48ifndef HAVE_PO4A
49# Strip from the source list any man pages we dont have compiled already
50SOURCE := $(wildcard $(SOURCE))
51endif
52
53# Chain to the manpage rule
54ifneq ($(words $(SOURCE)),0)
55include $(MANPAGE_H)
56endif
7652e03e
DK
57
58# Debian Doc SGML Documents
59SOURCE := $(wildcard *.$(LC).sgml)
46e39c8e 60DEBIANDOC_HTML_OPTIONS=-l $(LC).UTF-8
7652e03e 61include $(DEBIANDOC_H)