Statistics
| Branch: | Tag: | Revision:

root / debian / rules @ c55058f4

History | View | Annotate | Download (2.9 kB)

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
	./configure \
13
	  --prefix=/usr \
14
	  --localstatedir=/var \
15
	  --sysconfdir=/etc \
16
	  --with-export-dir=/var/lib/ganeti/export \
17
	  --with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
18
	  --with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
19
	  --with-extstorage-search-path=/srv/ganeti/extstorage,/usr/local/lib/ganeti/extstorage,/usr/lib/ganeti/extstorage,/usr/share/ganeti/extstorage \
20
	  --docdir=/usr/share/doc/ganeti \
21
	  --enable-htools-rapi
22

    
23
	  # --enable-restricted-commands \
24
	  #	--with-user-prefix=$(GNT_USERGROUP_PREFIX) \
25
	  #	 --with-group-prefix=$(GNT_USERGROUP_PREFIX)
26

    
27
override_dh_auto_clean:
28
	[ ! -f Makefile ] || $(MAKE) distclean
29
	# this is not removed by make distclean :(
30
	rm -f ganeti
31

    
32
	rm -f debian/snf-ganeti.ganeti.init
33
	rm -f debian/snf-ganeti.ganeti.cron.d
34
	rm -f debian/snf-ganeti.ganeti.default
35
	rm -f debian/snf-ganeti.postinst
36
	rm -f debian/snf-ganeti.postrm
37
	if [ -d doc/html.orig ]; then \
38
		rm -rf doc/html; \
39
		mv doc/html.orig doc/html; \
40
	fi
41
	dh_auto_clean
42

    
43
override_dh_auto_build:
44
	dh_auto_build
45
	mv doc/html doc/html.orig
46
	$(MAKE) doc/html
47
	$(CURDIR)/debian/genscript.py postinst "$(CURDIR)" | \
48
		sed -f "$(CURDIR)/autotools/replace_vars.sed" >"$(CURDIR)/debian/snf-ganeti.postinst"
49
	$(CURDIR)/debian/genscript.py postrm "$(CURDIR)" >"$(CURDIR)/debian/snf-ganeti.postrm"
50

    
51
# Add missing bits to ganeti and python-ganeti-rapi. We do not use
52
# override_dh_install (plain) because it will fail in binary-arch builds.
53
override_dh_install-indep:
54
	dh_install -i -Xganeti-confd -Xmon-collector -Xhail -Xganeti-mond -Xganeti-luxid --fail-missing
55
	cp $(CURDIR)/doc/examples/ganeti.initd $(CURDIR)/debian/snf-ganeti.ganeti.init
56
	cp $(CURDIR)/doc/examples/ganeti.cron $(CURDIR)/debian/snf-ganeti.ganeti.cron.d
57
	cp $(CURDIR)/doc/examples/ganeti.default $(CURDIR)/debian/snf-ganeti.ganeti.default
58
	
59
	# Dummy Python module for the RAPI client
60
	touch $(CURDIR)/debian/python-ganeti-rapi/usr/share/pyshared/ganeti/__init__.py
61
	touch $(CURDIR)/debian/python-ganeti-rapi/usr/share/pyshared/ganeti/rapi/__init__.py
62

    
63
override_dh_installinit:
64
	dh_installinit --name=ganeti --error-handler=true -i -- defaults 20 80
65

    
66
override_dh_installcron:
67
	dh_installcron --name=ganeti
68

    
69
override_dh_installlogrotate:
70
	dh_installlogrotate --name=ganeti
71

    
72
# Disable dh_sphinxdoc for binary-arch, as it will raise an error
73
override_dh_sphinxdoc-arch:
74

    
75
# Disable the test suite, as it requires the daemon users to be present
76
# at build time.
77
override_dh_auto_test:
78

    
79

    
80
.PHONY: override_dh_auto_configure override_dh_auto_clean override_dh_auto_build \
81
	override_dh_installinit override_dh_install-indep override_dh_sphinxdoc-arch \
82
	override_dh_auto_test