3 export HOME="$(CURDIR)/debian/test"
4 include /usr/share/openstack-pkg-tools/pkgos.make
5 export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)
8 dh $@ --with python2,systemd,sphinxdoc
12 rm -rf .testrepository
13 rm -f debian/ceilometer-common.config debian/ceilometer-common.postinst debian/ceilometer-api.config debian/ceilometer-api.postinst
16 rm -rf $(CURDIR)/debian/tmp
17 python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
18 dh_install --fail-missing
20 # Manage ceilometer.conf
21 mkdir -p $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common
22 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
23 --output-file $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf \
25 --namespace ceilometer \
26 --namespace oslo.concurrency \
28 --namespace oslo.log \
29 --namespace oslo.messaging \
30 --namespace oslo.middleware.cors \
31 --namespace oslo.policy \
32 --namespace oslo.service.service \
33 --namespace keystonemiddleware.auth_token
34 sed -i 's|[# \t]*auth_protocol[\t ]*=.*|auth_protocol=http|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
35 chmod 0644 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
36 sed -i 's|#connection[ \t]*=.*|connection=mongodb://localhost:27017/ceilometer|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
38 override_dh_auto_build:
40 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.config
41 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.postinst
42 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.config
43 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.postinst
45 override_dh_auto_clean:
47 rm -rf .testrepository
48 find . -iname '*.pyc' -delete
49 rm -f debian/*.init debian/*.service debian/*.upstart
51 override_dh_auto_test:
52 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
53 rm -rf .testrepository
56 TEMP_REZ=`mktemp -t` ; \
57 bash -x ./debian/setup-test-env-mongodb.sh testr run --subunit 'tests\.(?!(.*test_bin.*|.*functional.*|.*gabbi\.test_gabbi_prefix.*|.*meter\.test_notifications\.TestMeterProcessing\.test_fallback_meter_path.*|.*agent\.test_manager\.TestRunTasks\.test_batching_polled_samples_false.*))' | tee $$TEMP_REZ | subunit2pyunit ; \
58 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
63 override_dh_sphinxdoc:
64 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
65 PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html
66 mkdir -p $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static
67 touch $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static/toggle.js
68 dh_sphinxdoc -O--buildsystem=python_distutils