Generating config file from script, since it's gone from upstream.
[openstack-build/ceilometer-build.git] / trusty / debian / rules
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 include /usr/share/openstack-pkg-tools/pkgos.make
6
7 export OSLO_PACKAGE_VERSION=$(VERSION)
8
9 %:
10         dh $@  --with python2
11
12 override_dh_clean:
13         dh_clean
14         rm -rf .testrepository
15         rm -rf ceilometer.egg-info
16         rm -f debian/ceilometer-common.config debian/ceilometer-common.postinst debian/ceilometer-api.config debian/ceilometer-api.postinst
17
18 override_dh_install:
19         dh_install
20         PYTHONPATH=. bash tools/config/generate_sample.sh -b . -p ceilometer -o $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common
21         mv $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
22         chmod 0644 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
23
24 override_dh_auto_build:
25         dh_auto_build
26         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.config
27         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.postinst
28         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.config
29         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.postinst
30
31 override_dh_auto_clean:
32         dh_auto_clean
33         rm -rf debian/*.upstart
34         rm -rf debian/ceilometer-common.postinst
35         find . -iname '*.pyc' -delete
36
37 override_dh_auto_test:
38 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
39         rm -rf .testrepository
40         testr init
41         set -e && \
42                 TEMP_REZ=`mktemp -t` && \
43                 bash -x ./setup-test-env.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | tee $$TEMP_REZ | subunit2pyunit || true ; \
44                 cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats || true ; \
45                 rm -f $$TEMP_REZ ;
46         testr slowest
47 endif