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