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/etc/ceilometer
22 mkdir -p $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common
23 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
24 --output-file $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf \
26 --namespace ceilometer \
27 --namespace oslo.concurrency \
29 --namespace oslo.log \
30 --namespace oslo.messaging \
31 --namespace oslo.middleware.cors \
32 --namespace oslo.policy \
33 --namespace oslo.service.service \
34 --namespace keystonemiddleware.auth_token
35 #sed -i 's|[# \t]*auth_protocol[\t ]*=.*|auth_protocol=http|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
36 chmod 0644 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
37 #sed -i 's|#connection[ \t]*=.*|connection=mongodb://localhost:27017/ceilometer|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
38 cp -a $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf $(CURDIR)/debian/ceilometer-common/etc/ceilometer/
40 override_dh_auto_build:
42 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.config
43 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.postinst
44 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.config
45 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.postinst
47 override_dh_auto_clean:
49 rm -rf .testrepository
50 find . -iname '*.pyc' -delete
51 rm -f debian/*.init debian/*.service debian/*.upstart
53 override_dh_auto_test:
54 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
55 rm -rf .testrepository
58 TEMP_REZ=`mktemp -t` ; \
59 bash -x ./setup-test-env-mongodb.sh testr run --subunit 'tests\.(?!(.*test_bin.*|.*functional.*|.*gabbi\.test_gabbi_prefix.*))' | tee $$TEMP_REZ | subunit2pyunit ; \
60 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
65 override_dh_sphinxdoc:
66 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
67 PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html
68 mkdir -p $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static
69 touch $(CURDIR)/debian/ceilometer-doc/usr/share/doc/ceilometer-doc/html/_static/toggle.js
70 dh_sphinxdoc -O--buildsystem=python_distutils