3 include /usr/share/openstack-pkg-tools/pkgos.make
6 dh $@ --buildsystem=python_distutils --with python2,systemd,sphinxdoc
9 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
10 @echo "===> Running tests"
11 set -e ; set -x ; for i in 2.7 ; do \
12 PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
13 echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
14 rm -rf .testrepository ; \
15 testr-python$$PYMAJOR init ; \
16 TEMP_REZ=`mktemp -t` ; \
17 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.*))' | tee $$TEMP_REZ | subunit2pyunit ; \
18 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
20 testr-python$$PYMAJOR slowest ; \
25 dh_clean -O--buildsystem=python_distutils
26 rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst debian/cinder-volume.postinst
27 rm -rf debian/*.upstart debian/*.service
29 override_dh_auto_clean:
32 override_dh_auto_install:
36 python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
38 mkdir -p $(CURDIR)/debian/cinder-common/usr/share/cinder-common
39 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
40 --output-file $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf \
43 --namespace keystonemiddleware.auth_token \
44 --namespace oslo.config \
45 --namespace oslo.concurrency \
46 --namespace oslo.context \
48 --namespace oslo.i18n \
49 --namespace oslo.log \
50 --namespace oslo.messaging \
51 --namespace oslo.middleware \
52 --namespace oslo.policy \
53 --namespace oslo.reports \
54 --namespace oslo.rootwrap \
55 --namespace oslo.serialization \
56 --namespace oslo.service.periodic_task \
57 --namespace oslo.service.service \
58 --namespace oslo.service.sslutils \
59 --namespace oslo.service.wsgi \
60 --namespace oslo.utils \
61 --namespace oslo.versionedobjects \
62 --namespace oslo.vmware
63 # # The generator is currently missing enabled_backend and the [lvm]
64 # # section. This script fixes it until upstream gets smarter.
65 # chmod +x debian/gen-fixed-config
66 # ./debian/gen-fixed-config
67 # cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
69 dh_install --fail-missing -Xbin/cinder-all
70 install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
72 # Set LVM as default backend
73 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf DEFAULT enabled_backends lvm
74 echo "[lvm]" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
75 echo "volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
76 echo "volume_group = pkgosvg0" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
77 echo "iscsi_protocol = iscsi" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
78 echo "iscsi_helper = tgtadm" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
80 # Set a default value for lock_path & state_path
81 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf oslo_concurrency lock_path /var/lock/cinder
83 # Disable https in default setup, as this makes our CI fail
84 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf keystone_authtoken auth_protocol http
86 # Fix the missing sql_connection directive
87 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf database sqlite:////var/lib/cinder/cinderdb
89 # Put file under /etc/cinder
90 install -D -m 0644 $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf $(CURDIR)/debian/cinder-common/etc/cinder/cinder.conf
92 install -D -m 0644 $(CURDIR)/etc/cinder/logging_sample.conf $(CURDIR)/debian/cinder-common/usr/share/cinder-common/logging.conf
95 dh_fixperms -Xcinder_tgt.conf
96 chmod 0440 $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
98 override_dh_auto_build:
99 dh_auto_build -O--buildsystem=python_distutils
101 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.config
102 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.postinst
103 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.config
104 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.postinst
105 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-volume.postinst
107 override_dh_sphinxdoc:
108 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
109 PYTHONPATH=$(CURDIR) python setup.py build_sphinx
110 cp -rf doc/build/html $(CURDIR)/debian/cinder-doc/usr/share/doc/cinder-doc
111 dh_sphinxdoc -O--buildsystem=python_distutils