File: rules

package info (click to toggle)
cinder 2%3A9.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 27,264 kB
  • sloc: python: 307,915; xml: 736; sh: 543; pascal: 539; makefile: 82; sql: 23
file content (110 lines) | stat: -rwxr-xr-x 5,314 bytes parent folder | download
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
102
103
104
105
106
107
108
109
110
#!/usr/bin/make -f

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

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

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	@echo "===> Running tests"
	set -e ; set -x ; for i in 2.7 ; do \
		PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
		echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
		rm -rf .testrepository ; \
		testr-python$$PYMAJOR init ; \
		TEMP_REZ=`mktemp -t` ; \
		PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit 'cinder\.tests\.unit\.(?!(.*test_volume\.VolumeTestCase\.test_create_delete_volume.*|.*test_volume\.ConsistencyGroupTestCase\.test_create_delete_cgsnapshot.*|.*test_volume\.VolumeMigrationTestCase\.test_retype_volume_driver_success.*|.*test_volume\.VolumeMigrationTestCase\.test_retype_volume_migration_failed.*|.*backup\.test_backup\.BackupTestCase\.test_create_backup_with_temp_snapshot.*|.*test_volume\.VolumeMigrationTestCase\.test_retype_volume_migration_bad_policy.*))' | tee $$TEMP_REZ | subunit2pyunit ; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
		rm -f $$TEMP_REZ ; \
		testr-python$$PYMAJOR slowest ; \
	done
endif

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst debian/cinder-volume.postinst
	rm -rf debian/*.upstart debian/*.service

override_dh_auto_clean:
	echo "Do nothing..."

override_dh_auto_install:
	echo "Do nothing..."

override_dh_install:
	python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp

	mkdir -p $(CURDIR)/debian/cinder-common/usr/share/cinder-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
		--output-file $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf \
		--wrap-width 80 \
		--namespace castellan.config \
		--namespace cinder \
		--namespace keystonemiddleware.auth_token \
		--namespace oslo.config \
		--namespace oslo.concurrency \
		--namespace oslo.context \
		--namespace oslo.db \
		--namespace oslo.i18n \
		--namespace oslo.log \
		--namespace oslo.messaging \
		--namespace oslo.middleware \
		--namespace oslo.policy \
		--namespace oslo.reports \
		--namespace oslo.rootwrap \
		--namespace oslo.serialization \
		--namespace oslo.service.periodic_task \
		--namespace oslo.service.service \
		--namespace oslo.service.sslutils \
		--namespace oslo.service.wsgi \
		--namespace oslo.utils \
		--namespace oslo.versionedobjects \
		--namespace oslo.vmware
#	# The generator is currently missing enabled_backend and the [lvm]
#	# section. This script fixes it until upstream gets smarter.
#	chmod +x debian/gen-fixed-config
#	./debian/gen-fixed-config
#	cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf

	dh_install --fail-missing -Xbin/cinder-all
	install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common

	# Set LVM as default backend
	pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf DEFAULT enabled_backends lvm
	echo "[lvm]" 				>> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
	echo "volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
	echo "volume_group = pkgosvg0" 		>> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
	echo "iscsi_protocol = iscsi" 		>> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
	echo "iscsi_helper = tgtadm" 		>> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf

	# Set a default value for lock_path & state_path
	pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf oslo_concurrency lock_path /var/lock/cinder

	# Disable https in default setup, as this makes our CI fail
	pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf keystone_authtoken auth_protocol http

	# Fix the missing sql_connection directive
	pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf database sqlite:////var/lib/cinder/cinderdb

	install -D -m 0644 $(CURDIR)/etc/cinder/logging_sample.conf $(CURDIR)/debian/cinder-common/usr/share/cinder-common/logging.conf

override_dh_fixperms:
	dh_fixperms -Xcinder_tgt.conf
	chmod 0440 $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common

override_dh_auto_build:
	dh_auto_build -O--buildsystem=python_distutils

	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-volume.postinst

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. python setup.py build_sphinx
	cp -rf doc/build/html $(CURDIR)/debian/cinder-doc/usr/share/doc/cinder-doc
	dh_sphinxdoc -O--buildsystem=python_distutils
endif