Update QA scripts to new cluster parameters
[ganeti-local] / Makefile.am
1 # Ganeti makefile
2 # - Indent with tabs only.
3 # - Keep files sorted; one line per file.
4 # - Directories in lib/ must have their own *dir variable (see hypervisor).
5 # - All directories must be listed DIRS.
6 # - Use autogen.sh to generate Makefile.in and configure script.
7
8 # Automake doesn't export these variables before version 1.10.
9 abs_top_builddir = @abs_top_builddir@
10 abs_top_srcdir = @abs_top_srcdir@
11
12 ACLOCAL_AMFLAGS = -I autotools
13 DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
14 BUILD_RAPI_RESOURCE_DOC = $(top_srcdir)/doc/build-rapi-resources-doc
15 REPLACE_VARS_SED = autotools/replace_vars.sed
16
17 hypervisordir = $(pkgpythondir)/hypervisor
18 rapidir = $(pkgpythondir)/rapi
19 toolsdir = $(pkglibdir)/tools
20 docdir = $(datadir)/doc/$(PACKAGE)
21
22 DIRS = \
23         autotools \
24         daemons \
25         devel \
26         doc \
27         doc/examples \
28         lib \
29         lib/hypervisor \
30         lib/rapi \
31         man \
32         qa \
33         scripts \
34         test \
35         test/data \
36         tools
37
38 CLEANFILES = \
39         autotools/replace_vars.sed \
40         devel/upload \
41         doc/*.html \
42         doc/*.in \
43         doc/*.pdf \
44         $(patsubst %.dot,%.png,$(docdot)) \
45         doc/rapi-resources.sgml \
46         doc/examples/ganeti.initd \
47         doc/examples/ganeti.cron \
48         lib/*.py[co] \
49         lib/hypervisor/*.py[co] \
50         lib/rapi/*.py[co] \
51         man/*.[78] \
52         man/*.in \
53         qa/*.py[co] \
54         test/*.py[co] \
55         stamp-directories \
56         $(nodist_pkgpython_PYTHON)
57
58 nodist_pkgpython_PYTHON = \
59         lib/_autoconf.py
60
61 pkgpython_PYTHON = \
62         lib/__init__.py \
63         lib/backend.py \
64         lib/bdev.py \
65         lib/bootstrap.py \
66         lib/cli.py \
67         lib/cmdlib.py \
68         lib/config.py \
69         lib/constants.py \
70         lib/daemon.py \
71         lib/errors.py \
72         lib/http.py \
73         lib/jqueue.py \
74         lib/jstore.py \
75         lib/locking.py \
76         lib/luxi.py \
77         lib/mcpu.py \
78         lib/objects.py \
79         lib/opcodes.py \
80         lib/rpc.py \
81         lib/serializer.py \
82         lib/ssconf.py \
83         lib/ssh.py \
84         lib/utils.py \
85         lib/workerpool.py
86
87 hypervisor_PYTHON = \
88         lib/hypervisor/__init__.py \
89         lib/hypervisor/hv_base.py \
90         lib/hypervisor/hv_fake.py \
91         lib/hypervisor/hv_kvm.py \
92         lib/hypervisor/hv_xen.py
93
94 rapi_PYTHON = \
95         lib/rapi/__init__.py \
96         lib/rapi/baserlib.py \
97         lib/rapi/connector.py \
98         lib/rapi/rlib1.py \
99         lib/rapi/rlib2.py
100
101
102 docsgml = \
103         doc/hooks.sgml \
104         doc/install.sgml \
105         doc/admin.sgml \
106         doc/rapi.sgml \
107         doc/iallocator.sgml
108
109 docrst = \
110         doc/design-2.0.rst \
111         doc/security.rst
112
113 docdot = \
114         doc/arch-2.0.dot
115
116 doc_DATA = \
117         $(patsubst %.rst,%.html,$(docrst)) \
118         $(patsubst %.sgml,%.html,$(docsgml)) \
119         $(patsubst %.sgml,%.pdf,$(docsgml))
120
121 dist_sbin_SCRIPTS = \
122         daemons/ganeti-noded \
123         daemons/ganeti-watcher \
124         daemons/ganeti-masterd \
125         daemons/ganeti-rapi \
126         scripts/gnt-backup \
127         scripts/gnt-cluster \
128         scripts/gnt-debug \
129         scripts/gnt-instance \
130         scripts/gnt-job \
131         scripts/gnt-node \
132         scripts/gnt-os
133
134 dist_tools_SCRIPTS = \
135         tools/burnin \
136         tools/cfgshell \
137         tools/cfgupgrade \
138         tools/lvmstrap
139
140 EXTRA_DIST = \
141         NEWS \
142         DEVNOTES \
143         autotools/docbook-wrapper \
144         devel/upload.in \
145         $(docrst) \
146         $(docdot) \
147         $(docsgml) \
148         doc/build-rapi-resources-doc \
149         doc/examples/ganeti.initd.in \
150         doc/examples/ganeti.cron.in \
151         doc/examples/dumb-allocator \
152         doc/locking.txt \
153         test/testutils.py \
154         test/mocks.py \
155         $(dist_TESTS) \
156         $(TEST_FILES) \
157         man/footer.sgml \
158         $(mansgml) \
159         qa/ganeti-qa.py \
160         qa/qa-sample.json \
161         qa/qa_cluster.py \
162         qa/qa_config.py \
163         qa/qa_daemon.py \
164         qa/qa_env.py \
165         qa/qa_error.py \
166         qa/qa_instance.py \
167         qa/qa_node.py \
168         qa/qa_os.py \
169         qa/qa_rapi.py \
170         qa/qa_tags.py \
171         qa/qa_utils.py
172
173 man_MANS = \
174         man/ganeti.7 \
175         man/ganeti-noded.8 \
176         man/ganeti-os-interface.7 \
177         man/ganeti-watcher.8 \
178         man/gnt-backup.8 \
179         man/gnt-cluster.8 \
180         man/gnt-instance.8 \
181         man/gnt-node.8 \
182         man/gnt-os.8
183
184 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
185 mansgml = $(patsubst %.in,%.sgml,$(maninput))
186
187 TEST_FILES = \
188         test/data/bdev-both.txt \
189         test/data/bdev-disk.txt \
190         test/data/bdev-net.txt \
191         test/data/proc_drbd8.txt
192
193 dist_TESTS = \
194         test/ganeti.bdev_unittest.py \
195         test/ganeti.cli_unittest.py \
196         test/ganeti.cmdlib_unittest.py \
197         test/ganeti.config_unittest.py \
198         test/ganeti.constants_unittest.py \
199         test/ganeti.hooks_unittest.py \
200         test/ganeti.http_unittest.py \
201         test/ganeti.locking_unittest.py \
202         test/ganeti.rapi.resources_unittest.py \
203         test/ganeti.serializer_unittest.py \
204         test/ganeti.ssh_unittest.py \
205         test/ganeti.utils_unittest.py \
206         test/ganeti.workerpool_unittest.py
207
208 nodist_TESTS =
209
210 TESTS = $(dist_TESTS) $(nodist_TESTS)
211
212 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
213
214
215 all-local: stamp-directories lib/_autoconf.py devel/upload \
216         doc/examples/ganeti.initd doc/examples/ganeti.cron
217
218 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
219         sed -f $(REPLACE_VARS_SED) < $< > $@
220         chmod u+x $@
221
222 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
223                 $(REPLACE_VARS_SED)
224         sed -f $(REPLACE_VARS_SED) < $< > $@
225
226 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
227         sed -f $(REPLACE_VARS_SED) < $< > $@
228
229 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
230         sed -f $(REPLACE_VARS_SED) < $< > $@
231
232 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
233         $(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
234
235 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
236         $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
237
238 doc/%.html: doc/%.rst
239         $(RST2HTML) $< $@
240
241 doc/%.png: doc/%.dot
242         $(DOT) -Tpng -o $@ $<
243
244 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
245
246 doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
247
248 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
249         PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
250
251 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
252         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
253
254 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
255         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
256
257 man/footer.sgml $(TESTS): srclinks
258
259 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
260
261 lib/_autoconf.py: Makefile stamp-directories
262         set -e; \
263         { echo '# This file is automatically generated, do not edit!'; \
264           echo '#'; \
265           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
266           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
267           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
268           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
269           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
270           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
271           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
272           echo "SYSCONFDIR = '$(sysconfdir)'"; \
273           echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
274           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
275           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
276           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
277           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
278           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
279           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
280           echo "KVM_PATH = '$(KVM_PATH)'"; \
281         } > $@
282
283 $(REPLACE_VARS_SED): Makefile stamp-directories
284         set -e; \
285         { echo 's#@PREFIX@#$(prefix)#g'; \
286           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
287           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
288           echo 's#@SBINDIR@#$(sbindir)#g'; \
289           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
290           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
291           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
292           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
293           echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
294           echo '  r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
295           echo '  d'; \
296           echo '}'; \
297         } > $@
298
299 # We need to create symlinks because "make distcheck" will not install Python
300 # files when building.
301 #.PHONY: srclinks
302 srclinks: stamp-directories
303         set -e; \
304         for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
305                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
306                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
307                 fi; \
308         done
309
310 .PHONY: ganeti
311 ganeti:
312         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
313
314 # a dist hook rule for catching revision control directories
315 distcheck-hook:
316         if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
317                 echo "Found revision control files in final archive" 1>&2 ; \
318                 exit 1; \
319         fi
320
321 install-exec-local:
322         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
323           "$(DESTDIR)${localstatedir}/log/ganeti" \
324           "$(DESTDIR)${localstatedir}/run/ganeti"
325
326 stamp-directories: Makefile
327         @mkdir_p@ $(DIRS)
328         touch $@
329
330 .PHONY: apidoc
331 apidoc:
332         test -e doc/api || mkdir doc/api
333         TMPDIR=`mktemp -d ` && { \
334                 cp -r scripts daemons lib $$TMPDIR && \
335                 ( \
336                         CDIR=`pwd` && \
337                         cd $$TMPDIR && \
338                         mv lib ganeti && \
339                         epydoc --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
340                 ) ; \
341                 rm -rf $$TMPDIR ; \
342         }
343
344 # vim: set noet :