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