3 include /usr/share/openstack-pkg-tools/pkgos.make
4 export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)
9 dh $@ --buildsystem=python_distutils --with python2,systemd,sphinxdoc
11 override_dh_auto_test:
12 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
13 @echo "===> Running tests"
14 set -e ; set -x ; for i in 2.7 ; do \
15 PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
16 echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
17 rm -rf .testrepository ; \
18 testr-python$$PYMAJOR init ; \
19 TEMP_REZ=`mktemp -t` ; \
20 PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit 'cinder\.tests\.unit\.(?!.*test_volume\.VolumeTestCase\.test_create_delete_volume.*)' | tee $$TEMP_REZ | subunit2pyunit ; \
21 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
23 testr-python$$PYMAJOR slowest ; \
28 dh_clean -O--buildsystem=python_distutils
29 rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst debian/cinder-volume.postinst
30 rm -rf debian/*.upstart debian/*.service
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 \
57 --namespace oslo.utils \
58 --namespace oslo.versionedobjects \
59 --namespace oslo.vmware
60 # The generator is currently missing enabled_backend and the [lvm]
61 # section. This script fixes it until upstream gets smarter.
62 # chmod +x debian/gen-fixed-config
63 # ./debian/gen-fixed-config
64 # cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
66 dh_install --fail-missing -Xbin/cinder-all
67 install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
69 # Set a default value for lock_path & state_path
70 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf oslo_concurrency lock_path /var/lock/cinder
71 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf oslo_concurrency state_path /var/lib/cinder
73 # Disable https in default setup, as this makes our CI fail
74 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf keystone_authtoken auth_protocol http
76 # Fix the missing sql_connection directive
77 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf database connection sqlite:////var/lib/cinder/cinderdb
79 # Put file under /etc/cinder
80 install -D -m 0644 $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf $(CURDIR)/debian/cinder-common/etc/cinder/cinder.conf
82 # Set LVM as default backend
83 pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf DEFAULT enabled_backends lvm
84 echo "[lvm]" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
85 echo "volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
86 echo "volume_group = pkgosvg0" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
87 echo "iscsi_protocol = iscsi" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
88 echo "iscsi_helper = tgtadm" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
90 install -D -m 0644 $(CURDIR)/etc/cinder/logging_sample.conf $(CURDIR)/debian/cinder-common/usr/share/cinder-common/logging.conf
93 dh_fixperms -Xcinder_tgt.conf
94 chmod 0440 $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
96 override_dh_auto_build:
97 dh_auto_build -O--buildsystem=python_distutils
99 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.config
100 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-common.postinst
101 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.config
102 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-api.postinst
103 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cinder-volume.postinst
105 override_dh_sphinxdoc:
106 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
107 python setup.py build_sphinx
108 cp -rf doc/build/html $(CURDIR)/debian/cinder-doc/usr/share/doc/cinder-doc
109 dh_sphinxdoc -O--buildsystem=python_distutils