Uncruft testr runs.
[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         install -D -m 0644 $(CURDIR)/etc/ceilometer/ceilometer.conf.sample      $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf
21         install -D -m 0644 $(CURDIR)/etc/ceilometer/policy.json                 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/policy.json
22         install -D -m 0644 $(CURDIR)/etc/ceilometer/sources.json                $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/sources.json
23         install -D -m 0644 $(CURDIR)/etc/ceilometer/pipeline.yaml               $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/pipeline.yaml
24
25 override_dh_auto_build:
26         dh_auto_build
27         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.config
28         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-common.postinst
29         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.config
30         /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ceilometer-api.postinst
31
32 override_dh_auto_clean:
33         dh_auto_clean
34         rm -rf debian/*.upstart
35         rm -rf debian/ceilometer-common.postinst
36         find . -iname '*.pyc' -delete
37
38 override_dh_auto_test:
39 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
40         rm -rf .testrepository
41         testr init
42         bash -x ./setup-test-env.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | tee $$TEMP_REZ | subunit2pyunit || true
43         test slowest
44         testr last --subunit | subunit-filter -s --no-passthrough | subunit-stats
45 endif