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 dh_install --fail-missing
18 # Manage ceilometer.conf
19 mkdir -p $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common
20 oslo-config-generator --output-file $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf \
21 --namespace ceilometer \
23 --namespace oslo.messaging \
24 --namespace oslo.policy \
25 --namespace keystonemiddleware.auth_token
26 sed -i 's|[# \t]*auth_protocol[\t ]*=.*|auth_protocol=http|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
27 chmod 0644 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
28 sed -i 's|#connection[ \t]*=.*|connection=mongodb://localhost:27017/ceilometer|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
30 override_dh_auto_build:
32 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.config
33 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.postinst
34 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.config
35 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.postinst
37 override_dh_auto_clean:
39 rm -rf .testrepository
40 find . -iname '*.pyc' -delete
41 rm -f debian/*.init debian/*.service debian/*.upstart
43 override_dh_auto_test:
44 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
45 rm -rf .testrepository
48 TEMP_REZ=`mktemp -t` ; \
49 bash -x ./setup-test-env-mongodb.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | tee $$TEMP_REZ | subunit2pyunit ; \
50 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
55 override_dh_sphinxdoc:
56 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
57 PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html
58 mkdir -p $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static
59 touch $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static/toggle.js
60 dh_sphinxdoc -O--buildsystem=python_distutils