Add empty ganeti.confd module
[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 REPLACE_VARS_SED = autotools/replace_vars.sed
15
16 hypervisordir = $(pkgpythondir)/hypervisor
17 httpdir = $(pkgpythondir)/http
18 confddir = $(pkgpythondir)/confd
19 rapidir = $(pkgpythondir)/rapi
20 toolsdir = $(pkglibdir)/tools
21 docdir = $(datadir)/doc/$(PACKAGE)
22
23 DIRS = \
24         autotools \
25         daemons \
26         devel \
27         doc \
28         doc/examples \
29         lib \
30         lib/http \
31         lib/hypervisor \
32         lib/rapi \
33         lib/confd \
34         man \
35         qa \
36         scripts \
37         test \
38         test/data \
39         tools
40
41 MAINTAINERCLEANFILES = \
42         $(docpng) \
43         $(maninput)
44
45 maintainer-clean-local:
46         -rm -rf doc/api doc/build doc/html
47
48 CLEANFILES = \
49         autotools/replace_vars.sed \
50         devel/upload \
51         doc/examples/bash_completion \
52         doc/examples/ganeti.initd \
53         doc/examples/ganeti.cron \
54         lib/*.py[co] \
55         lib/http/*.py[co] \
56         lib/hypervisor/*.py[co] \
57         lib/rapi/*.py[co] \
58         $(man_MANS) \
59         $(manhtml) \
60         qa/*.py[co] \
61         test/*.py[co] \
62         stamp-directories \
63         $(nodist_pkgpython_PYTHON)
64
65 nodist_pkgpython_PYTHON = \
66         lib/_autoconf.py
67
68 pkgpython_PYTHON = \
69         lib/__init__.py \
70         lib/asyncnotifier.py \
71         lib/backend.py \
72         lib/bdev.py \
73         lib/bootstrap.py \
74         lib/cli.py \
75         lib/cmdlib.py \
76         lib/config.py \
77         lib/constants.py \
78         lib/daemon.py \
79         lib/errors.py \
80         lib/jqueue.py \
81         lib/jstore.py \
82         lib/locking.py \
83         lib/luxi.py \
84         lib/mcpu.py \
85         lib/objects.py \
86         lib/opcodes.py \
87         lib/rpc.py \
88         lib/serializer.py \
89         lib/ssconf.py \
90         lib/ssh.py \
91         lib/storage.py \
92         lib/utils.py \
93         lib/workerpool.py
94
95 hypervisor_PYTHON = \
96         lib/hypervisor/__init__.py \
97         lib/hypervisor/hv_base.py \
98         lib/hypervisor/hv_chroot.py \
99         lib/hypervisor/hv_fake.py \
100         lib/hypervisor/hv_kvm.py \
101         lib/hypervisor/hv_xen.py
102
103 rapi_PYTHON = \
104         lib/rapi/__init__.py \
105         lib/rapi/baserlib.py \
106         lib/rapi/connector.py \
107         lib/rapi/rlib2.py
108
109 http_PYTHON = \
110         lib/http/__init__.py \
111         lib/http/auth.py \
112         lib/http/client.py \
113         lib/http/server.py
114
115 confd_PYTHON = \
116         lib/confd/__init__.py
117
118 docrst = \
119         doc/admin.rst \
120         doc/design-2.0.rst \
121         doc/design-2.1.rst \
122         doc/glossary.rst \
123         doc/hooks.rst \
124         doc/iallocator.rst \
125         doc/index.rst \
126         doc/install.rst \
127         doc/rapi.rst \
128         doc/security.rst
129
130 doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
131         @test -n "$(SPHINX)" || \
132             { echo 'sphinx-build' not found during configure; exit 1; }
133         mkdir -p doc/build/doctrees
134         PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
135             -d doc/build/doctrees \
136             -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
137             -D release="$(PACKAGE_VERSION)" \
138             $(top_srcdir)/doc doc/html
139         touch "$@"
140
141 docdot = \
142         doc/arch-2.0.dot
143
144 docpng = $(patsubst %.dot,%.png,$(docdot))
145
146 noinst_DATA = $(manhtml) doc/html
147
148 dist_sbin_SCRIPTS = \
149         daemons/ganeti-noded \
150         daemons/ganeti-watcher \
151         daemons/ganeti-masterd \
152         daemons/ganeti-rapi \
153         scripts/gnt-backup \
154         scripts/gnt-cluster \
155         scripts/gnt-debug \
156         scripts/gnt-instance \
157         scripts/gnt-job \
158         scripts/gnt-node \
159         scripts/gnt-os
160
161 dist_tools_SCRIPTS = \
162         tools/burnin \
163         tools/cfgshell \
164         tools/cfgupgrade \
165         tools/lvmstrap
166
167 EXTRA_DIST = \
168         $(MAINTAINERCLEANFILES) \
169         NEWS \
170         DEVNOTES \
171         pylintrc \
172         autotools/docbook-wrapper \
173         devel/upload.in \
174         $(docdot) \
175         $(docrst) \
176         doc/conf.py \
177         doc/html \
178         doc/examples/bash_completion.in \
179         doc/examples/ganeti.initd.in \
180         doc/examples/ganeti.cron.in \
181         doc/examples/dumb-allocator \
182         doc/locking.txt \
183         test/testutils.py \
184         test/mocks.py \
185         $(dist_TESTS) \
186         $(TEST_FILES) \
187         man/footer.sgml \
188         $(mansgml) $(maninput) \
189         qa/ganeti-qa.py \
190         qa/qa-sample.json \
191         qa/qa_cluster.py \
192         qa/qa_config.py \
193         qa/qa_daemon.py \
194         qa/qa_env.py \
195         qa/qa_error.py \
196         qa/qa_instance.py \
197         qa/qa_node.py \
198         qa/qa_os.py \
199         qa/qa_rapi.py \
200         qa/qa_tags.py \
201         qa/qa_utils.py
202
203 man_MANS = \
204         man/ganeti.7 \
205         man/ganeti-masterd.8 \
206         man/ganeti-noded.8 \
207         man/ganeti-os-interface.7 \
208         man/ganeti-rapi.8 \
209         man/ganeti-watcher.8 \
210         man/gnt-backup.8 \
211         man/gnt-cluster.8 \
212         man/gnt-debug.8 \
213         man/gnt-instance.8 \
214         man/gnt-job.8 \
215         man/gnt-node.8 \
216         man/gnt-os.8
217
218 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
219 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
220 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
221
222 TEST_FILES = \
223         test/data/bdev-both.txt \
224         test/data/bdev-8.3-both.txt \
225         test/data/bdev-disk.txt \
226         test/data/bdev-net.txt \
227         test/data/proc_drbd8.txt \
228         test/data/proc_drbd83.txt
229
230 dist_TESTS = \
231         test/ganeti.bdev_unittest.py \
232         test/ganeti.cli_unittest.py \
233         test/ganeti.cmdlib_unittest.py \
234         test/ganeti.config_unittest.py \
235         test/ganeti.constants_unittest.py \
236         test/ganeti.hooks_unittest.py \
237         test/ganeti.http_unittest.py \
238         test/ganeti.locking_unittest.py \
239         test/ganeti.objects_unittest.py \
240         test/ganeti.rapi.resources_unittest.py \
241         test/ganeti.serializer_unittest.py \
242         test/ganeti.ssh_unittest.py \
243         test/ganeti.utils_unittest.py \
244         test/ganeti.workerpool_unittest.py
245
246 nodist_TESTS =
247
248 TESTS = $(dist_TESTS) $(nodist_TESTS)
249
250 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
251
252 all-local: stamp-directories lib/_autoconf.py devel/upload \
253         doc/examples/bash_completion \
254         doc/examples/ganeti.initd doc/examples/ganeti.cron
255
256 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
257         sed -f $(REPLACE_VARS_SED) < $< > $@
258         chmod u+x $@
259
260 doc/examples/%: doc/examples/%.in stamp-directories \
261                 $(REPLACE_VARS_SED)
262         sed -f $(REPLACE_VARS_SED) < $< > $@
263
264 doc/%.png: doc/%.dot
265         @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
266         $(DOT) -Tpng -o $@ $<
267
268 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
269         @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
270         TMPDIR=`mktemp -d` && { \
271         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
272         mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
273         rm -rf "$$TMPDIR" ; \
274         }
275
276 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
277         @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
278         TMPDIR=`mktemp -d` && { \
279         $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
280         mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
281         rm -rf "$$TMPDIR" ; \
282         }
283
284 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
285         sed -f $(REPLACE_VARS_SED) < $< > $@
286
287 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
288         sed -f $(REPLACE_VARS_SED) < $< > $@
289
290 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
291         sed -f $(REPLACE_VARS_SED) < $< > $@
292
293 man/footer.sgml $(TESTS): srclinks
294
295 $(TESTS): ganeti lib/_autoconf.py
296
297 lib/_autoconf.py: Makefile stamp-directories
298         set -e; \
299         { echo '# This file is automatically generated, do not edit!'; \
300           echo '#'; \
301           echo ''; \
302           echo '"""Build-time configuration for Ganeti.'; \
303           echo '';\
304           echo 'This file is autogenerated by the build process.'; \
305           echo 'For any changes you need to re-run ./configure (and'; \
306           echo 'not edit by hand).'; \
307           echo ''; \
308           echo '"""'; \
309           echo ''; \
310           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
311           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
312           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
313           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
314           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
315           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
316           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
317           echo "SYSCONFDIR = '$(sysconfdir)'"; \
318           echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
319           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
320           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
321           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
322           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
323           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
324           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
325           echo "KVM_PATH = '$(KVM_PATH)'"; \
326           echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
327           echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
328           echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)" ; \
329         } > $@
330
331 $(REPLACE_VARS_SED): Makefile stamp-directories
332         set -e; \
333         { echo 's#@PREFIX@#$(prefix)#g'; \
334           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
335           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
336           echo 's#@SBINDIR@#$(sbindir)#g'; \
337           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
338           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
339           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
340           echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
341         } > $@
342
343 # We need to create symlinks because "make distcheck" will not install Python
344 # files when building.
345 #.PHONY: srclinks
346 srclinks: stamp-directories
347         set -e; \
348         for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
349                         $(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON); do \
350                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
351                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
352                 fi; \
353         done
354
355 .PHONY: ganeti
356 ganeti:
357         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
358
359 # a dist hook rule for catching revision control directories
360 distcheck-hook:
361         if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
362                 echo "Found revision control files in final archive" 1>&2 ; \
363                 exit 1; \
364         fi
365
366 install-exec-local:
367         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
368           "$(DESTDIR)${localstatedir}/log/ganeti" \
369           "$(DESTDIR)${localstatedir}/run/ganeti"
370
371 stamp-directories: Makefile
372         @mkdir_p@ $(DIRS)
373         touch $@
374
375 .PHONY: apidoc
376 apidoc:
377         test -e doc/api || mkdir doc/api
378         TMPDIR=`mktemp -d ` && { \
379                 cp -r scripts daemons lib $$TMPDIR && \
380                 ( \
381                         CDIR=`pwd` && \
382                         cd $$TMPDIR && \
383                         mv lib ganeti && \
384                         epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
385                 ) ; \
386                 rm -rf $$TMPDIR ; \
387         }
388
389 .PHONY: TAGS
390 TAGS:
391         rm -f TAGS
392         find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
393           -path 'daemons/ganeti-*' -o -path 'tools/*' | \
394           etags -
395
396 # vim: set noet :