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