Bump new upstream version
[ganeti-local] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 GNT_USERGROUP_PREFIX="gnt-"
7
8 %:
9         dh $@ --with python2,sphinxdoc,bash_completion
10
11 override_dh_auto_configure:
12         ./autogen.sh
13         ./configure \
14           --prefix=/usr \
15           --localstatedir=/var \
16           --sysconfdir=/etc \
17           --with-export-dir=/var/lib/ganeti/export \
18           --with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
19           --with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
20           --with-extstorage-search-path=/srv/ganeti/extstorage,/usr/local/lib/ganeti/extstorage,/usr/lib/ganeti/extstorage,/usr/share/ganeti/extstorage \
21           --docdir=/usr/share/doc/ganeti \
22           --enable-htools-rapi
23
24 #   --enable-restricted-commands \
25 #         --with-user-prefix=$(GNT_USERGROUP_PREFIX) \
26 #         --with-group-prefix=$(GNT_USERGROUP_PREFIX)
27
28 override_dh_auto_clean:
29         [ ! -f Makefile ] || $(MAKE) distclean
30         # this is not removed by make distclean :(
31         rm -f ganeti
32
33         rm -f debian/snf-ganeti.ganeti.init
34         rm -f debian/snf-ganeti.ganeti.cron.d
35         rm -f debian/snf-ganeti.ganeti.default
36         rm -f debian/snf-ganeti.postinst
37         rm -f debian/snf-ganeti.postrm
38         if [ -d doc/html.orig ]; then \
39                 rm -rf doc/html; \
40                 mv doc/html.orig doc/html; \
41         fi
42         dh_auto_clean
43
44 override_dh_auto_build:
45         dh_auto_build
46         mv doc/html doc/html.orig
47         $(MAKE) doc/html
48         $(CURDIR)/debian/genscript.py postinst "$(CURDIR)" | \
49                 sed -f "$(CURDIR)/autotools/replace_vars.sed" >"$(CURDIR)/debian/snf-ganeti.postinst"
50         $(CURDIR)/debian/genscript.py postrm "$(CURDIR)" >"$(CURDIR)/debian/snf-ganeti.postrm"
51
52 # Add missing bits to ganeti and python-ganeti-rapi. We do not use
53 # override_dh_install (plain) because it will fail in binary-arch builds.
54 override_dh_install-indep:
55         dh_install -i -Xganeti-confd -Xmon-collector -Xhail -Xganeti-mond -Xganeti-luxid --fail-missing
56         cp $(CURDIR)/doc/examples/ganeti.initd $(CURDIR)/debian/snf-ganeti.ganeti.init
57         cp $(CURDIR)/doc/examples/ganeti.cron $(CURDIR)/debian/snf-ganeti.ganeti.cron.d
58         cp $(CURDIR)/doc/examples/ganeti.default $(CURDIR)/debian/snf-ganeti.ganeti.default
59         
60         # Dummy Python module for the RAPI client
61         touch $(CURDIR)/debian/python-ganeti-rapi/usr/share/pyshared/ganeti/__init__.py
62         touch $(CURDIR)/debian/python-ganeti-rapi/usr/share/pyshared/ganeti/rapi/__init__.py
63
64 override_dh_installinit:
65         dh_installinit --name=ganeti --error-handler=true -i -- defaults 20 80
66
67 override_dh_installcron:
68         dh_installcron --name=ganeti
69
70 # Disable dh_sphinxdoc for binary-arch, as it will raise an error
71 override_dh_sphinxdoc-arch:
72
73 # Disable the test suite, as it requires the daemon users to be present
74 # at build time.
75 override_dh_auto_test:
76
77
78 .PHONY: override_dh_auto_configure override_dh_auto_clean override_dh_auto_build \
79         override_dh_installinit override_dh_install-indep override_dh_sphinxdoc-arch \
80         override_dh_auto_test