summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 4e4664e87352cc47cdae6c971dca1ed759d06bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/make -f

# export DH_VERBOSE=1

include /usr/share/openstack-pkg-tools/pkgos.make

export OSLO_PACKAGE_VERSION=$(VERSION)

include /usr/share/python/python.mk
debroot = debian/tmp
site_packages_dir=$(debroot)$(call py_libdir,$(shell pyversions -d))

%:
	dh $@ --buildsystem=python_distutils --with python2,sphinxdoc

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/build/ doc/source/api doc/.autogenerated
	rm -rf tests.sqlite clean.sqlite run_tests.log
	rm -rf CA
	rm -rf nova.egg-info
	rm -f po/nova.pot
	rm -rf .autogenerated
	rm -f debian/nova-common.config debian/nova-common.postinst debian/nova-compute-xen.postinst \
		debian/nova-api.config debian/nova-api.postinst
	rm -f debian/*.upstart

override_dh_auto_build:
	dh_auto_build

	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func nova-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func nova-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func nova-api.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func nova-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func nova-compute-xen.postinst

override_dh_sphinxdoc:
	echo skipping docs

override_dh_installman:
	echo skipping man


override_dh_install:
	python setup.py install -f --install-layout=deb --root=$(debroot)
	mkdir -p $(debroot)/usr/share
#	mv $(site_packages_dir)/nova/locale $(debroot)/usr/share

	rm debian/tmp/usr/bin/nova-api-os-compute
	rm debian/tmp/usr/bin/nova-api-metadata
	rm debian/tmp/usr/bin/nova-api-ec2

	dh_install --fail-missing -Xbin/nova-all -Xbin/nova-objectstore
	install -D -m 0440 $(CURDIR)/debian/nova-common.sudoers $(CURDIR)/debian/nova-common/etc/sudoers.d/nova-common
	install -D -m 0644 $(CURDIR)/etc/nova/logging_sample.conf $(CURDIR)/debian/nova-common/usr/share/nova-common/logging.conf
	set -e ; for hypervisor in qemu kvm uml lxc; do \
		install -D -m 0600 $(CURDIR)/debian/nova-compute-$${hypervisor}.conf $(CURDIR)/debian/nova-compute-$${hypervisor}/etc/nova/nova-compute.conf; \
	done
	install -D -m 0600 $(CURDIR)/debian/nova-compute-baremetal.conf $(CURDIR)/debian/nova-baremetal/etc/nova/nova-compute.conf
	install -D -m 0600 $(CURDIR)/debian/nova-compute-xen.conf.dist $(CURDIR)/debian/nova-compute-xen/usr/share/nova-compute-xen/nova-compute.conf
	find $(CURDIR)/debian -name .gitignore -delete

override_dh_fixperms:
	dh_fixperms -Xnova_sudoers
	dh_fixperms -Xnova_tgt
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/.gitignore
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/projects/.gitignore
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/reqs/.gitignore

	# Make sure all our plugins are executable
#	set -e ; for i in $(CURDIR)/debian/nova-xcp-plugins/usr/lib/xcp/plugins/* ; do \
#		chmod +x $$i ; \
#	done
#	# Don't ask, that's as stupid as it seems... (and it wouldn't work without this!)
#	mkdir -p $(CURDIR)/debian/nova-xcp-plugins/etc/xcp
#	echo "{}" >$(CURDIR)/debian/nova-xcp-plugins/etc/xcp/xenhost.conf
#	chmod 0440 $(CURDIR)/debian/nova-common/etc/sudoers.d/nova-common

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	./run_tests.sh -N -P || true
	#python setup.py testr --slowest --testr-args='--subunit  ' || true
endif

# We use override_dh_installmenu because it's done in the sequence with dh,
# and we already override dh_installinit in pkgos.make.
# Obviously, we will never use a Desktop menu in such a package, so that's
# not a problem.
override_dh_installmenu:
	#dh_installinit -pnova-console --name=nova-consoleauth
	dh_installinit --name=nova-novncproxy
	dh_installinit --name=nova-spicehtml5proxy
	dh_installinit --name=nova-xenvncproxy
	install -D -m 0644 $(CURDIR)/debian/nova-consoleproxy.mydefault $(CURDIR)/debian/nova-consoleproxy/usr/share/nova-consoleproxy/default

override_dh_python2:
	dh_python2
	# This is needed for the XCP plugins, which have to be installed in
	# a non-standard directory. This is a problem upstream which isn't
	# fixable in Debian easily (though it isn't a policy violation).
	dh_python2  /usr/lib/xcp