Imported Upstream version 3.3.1
[debian/amanda] / man / Makefile.am
1 # Makefile for amanda man-pages
2
3 .SECONDARY:
4
5 transform =     s,x,x,;
6
7 AMPLOT_MAN_PAGES =  amplot.8
8
9 COMMON_MAN_PAGES =  amanda.8 \
10                     amanda.conf.5 \
11                     amanda-client.conf.5 \
12                     amanda-scripts.7 \
13                     amanda-archive-format.5 \
14                     amanda-auth.7 \
15                     amanda-match.7 \
16                     amarchiver.8 \
17                     amservice.8 \
18                     script-email.8
19
20 CLIENT_MAN_PAGES = \
21     amanda-applications.7 \
22     amdump_client.8 \
23     amgtar.8 \
24     ampgsql.8 \
25     amraw.8 \
26     amsamba.8 \
27     amstar.8 \
28     amsuntar.8 \
29     amzfs-snapshot.8 \
30     amzfs-sendrecv.8
31
32 SERVER_MAN_PAGES =  \
33     amanda-devices.7 \
34     amanda-compatibility.7 \
35     amanda-changers.7 \
36     amanda-interactivity.7 \
37     amanda-taperscan.7 \
38     amaddclient.8    \
39     amadmin.8 \
40     amaespipe.8 \
41     amcheck.8 \
42     amcheckdb.8 \
43     amcheckdump.8 \
44     amcleanup.8 \
45     amcleanupdisk.8 \
46     amcrypt-ossl-asym.8 \
47     amcrypt-ossl.8   \
48     amcrypt.8 \
49     amcryptsimple.8  \
50     amdevcheck.8 \
51     amdump.8 \
52     amflush.8 \
53     amgetconf.8 \
54     amgpgcrypt.8 \
55     amlabel.8 \
56     amoverview.8 \
57     amreport.8 \
58     amrmtape.8 \
59     amserverconfig.8 \
60     amstatus.8 \
61     amtape.8 \
62     amtapetype.8 \
63     amtoc.8 \
64     amvault.8 \
65     disklist.5 \
66     tapelist.5
67
68 RECOVER_MAN_PAGES =  amrecover.8
69
70 RESTORE_MAN_PAGES =  amrestore.8 \
71                      amfetchdump.8
72
73 ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \
74            $(CLIENT_MAN_PAGES) \
75            $(COMMON_MAN_PAGES) \
76            $(SERVER_MAN_PAGES) \
77            $(RECOVER_MAN_PAGES) \
78            $(RESTORE_MAN_PAGES)
79
80 WANTED_MAN_PAGES = $(COMMON_MAN_PAGES)
81 if WANT_AMPLOT
82   WANTED_MAN_PAGES += $(AMPLOT_MAN_PAGES)
83 endif
84 if WANT_CLIENT
85   WANTED_MAN_PAGES += $(CLIENT_MAN_PAGES)
86 endif
87 if WANT_SERVER
88   WANTED_MAN_PAGES += $(SERVER_MAN_PAGES)
89 endif
90 if WANT_RECOVER
91   WANTED_MAN_PAGES += $(RECOVER_MAN_PAGES)
92 endif
93 if WANT_RESTORE
94   WANTED_MAN_PAGES += $(RESTORE_MAN_PAGES)
95 endif
96
97 SRCMANPAGEDIR  = $(srcdir)/xml-source
98
99 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
100
101 EXTRA_XML = xslt/expand-sambadoc.xsl \
102             xslt/man.xsl.in \
103             xslt/html.xsl.in \
104             xslt/settings.xsl \
105             entities/global.entities.in \
106             entities/xinclude.dtd
107
108 EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML)
109
110 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
111
112 MOSTLYCLEANFILES = $(GEN_XML)
113 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
114
115 # some of the XSL needs to know what docbook-xsl version we've selected
116 %.xsl: %.xsl.in $(top_builddir)/config.status
117         $(top_builddir)/config.status --file=$@:$<
118         rm -f config.log
119
120 entities/global.entities: entities/global.entities.in $(top_builddir)/config.status
121         $(top_builddir)/config.status --file=$@:$<
122         rm -f config.log
123
124 if   ENABLE_MANPAGE_BUILD
125 # phase one of the documentation build expands some macros.
126 xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl entities/global.entities
127         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
128
129 # phase two generates a manpage from the resulting "expanded" docbook XML
130 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl entities/global.entities
131         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --output $@ xslt/man.xsl $<
132
133 %.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl entities/global.entities
134         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --output $@ xslt/html.xsl $<
135
136 else    !ENABLE_MANPAGE_BUILD
137
138 %: $(SRCMANPAGEDIR)/%.xml
139         @echo WARNING: Not building needed $@ because building manpages is disabled.
140         @echo 'DUMMY' > $@
141
142 # (no rule to build HTML without ENABLE_MANPAGE_BUILD)
143
144 endif
145
146 ##
147 ## HTML Generation
148 ##
149
150 EXTRA_DIST += \
151         index.php \
152         amanda.css
153
154 ALL_MAN_HTMLS = $(ALL_MAN_PAGES:%=%.html)
155
156 # toplevel rule to build HTML manpages and tar them up
157 html: amanda.css index.php $(ALL_MAN_HTMLS)
158         tar -zcf html.tar.gz $(ALL_MAN_HTMLS) amanda.css index.php
159
160 # double-check that we don't ship dummy manpages
161 dist-hook:
162         for f in $(WANTED_MAN_PAGES); do \
163                 if sed -e 1q $(distdir)/$$f | $(GREP) '^DUMMY$$' >/dev/null 2>/dev/null; then \
164                         echo "$(distdir)/$$f is a dummy manpage; cannot create distribution"; \
165                         exit 1; \
166                 fi; \
167         done
168
169 man_MANS = $(WANTED_MAN_PAGES)