File: rules

package info (click to toggle)
zaqar 3.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,228 kB
  • ctags: 3,718
  • sloc: python: 29,033; xml: 3,126; sh: 367; java: 135; makefile: 54
file content (62 lines) | stat: -rwxr-xr-x 2,754 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/make -f

include /usr/share/openstack-pkg-tools/pkgos.make
export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)

%:
	dh $@ --buildsystem=python_distutils --with python2,systemd

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	@echo "===> Running tests"
	set -e ; set -x ; for i in 2.7 ; do \
		PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
		echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
		rm -rf .testrepository ; \
		testr-python$$PYMAJOR init ; \
		TEMP_REZ=`mktemp -t` ; \
		bash -x ./debian/setup-test-env-mongodb.sh testr-python$$PYMAJOR run --subunit 'zaqar\.tests\.unit\.(?!.*transport\.websocket\.v2\.test_subscriptions\.SubscriptionTest\.test_subscription_sustainable_notifications_format.*)' | tee $$TEMP_REZ | subunit2pyunit ; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
		rm -f $$TEMP_REZ ; \
		testr-python$$PYMAJOR slowest ; \
	done
endif

override_dh_auto_build:
	dh_auto_build -O--buildsystem=python_distutils
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func zaqar-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func zaqar-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func zaqar-server.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func zaqar-server.postinst

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf build \
		debian/zaqar-common.postinst \
		debian/zaqar-common.config \
		debian/zaqar-server.postinst \
		debian/zaqar-server.config \
		debian/*.service debian/*.init debian/*.upstart

override_dh_install:
	rm -rf $(CURDIR)/debian/tmp
	python2.7 setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp
	dh_install --fail-missing
	mkdir -p $(CURDIR)/debian/zaqar-common/usr/share/zaqar-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator --output-file $(CURDIR)/debian/zaqar-common/usr/share/zaqar-common/zaqar.conf \
		--namespace zaqar.bootstrap \
		--namespace zaqar.common.configs \
		--namespace zaqar.storage.pipeline \
		--namespace zaqar.storage.pooling \
		--namespace zaqar.storage.mongodb \
		--namespace zaqar.storage.redis \
		--namespace zaqar.storage.sqlalchemy \
		--namespace zaqar.transport.wsgi \
		--namespace zaqar.transport.base \
		--namespace zaqar.transport.validation \
		--namespace keystonemiddleware.auth_token

	for i in policy.json zaqar-benchmark.conf logging.conf ; do \
		cp etc/$$i.sample $(CURDIR)/debian/zaqar-common/usr/share/zaqar-common/$$i ; \
	done
	cp etc/zaqar-benchmark-messages.json $(CURDIR)/debian/zaqar-common/usr/share/zaqar-common