File: rules

package info (click to toggle)
openstack-trove 1:6.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,412 kB
  • ctags: 13,061
  • sloc: python: 77,471; sh: 496; makefile: 52
file content (71 lines) | stat: -rwxr-xr-x 3,367 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
#!/usr/bin/make -f

PYTHONS:=$(shell pyversions -vr)

UPSTREAM_GIT := https://github.com/openstack/trove.git

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,sphinxdoc,systemd

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/trove-common.postinst
	rm -f debian/trove-common.config
	rm -f debian/trove-api.postinst
	rm -f debian/trove-api.config
	rm -f debian/*.init debian/*.service debian/*.upstart

override_dh_auto_build:
	dh_auto_build
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func trove-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func trove-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func trove-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func trove-api.config

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build -b html doc/source debian/trove-doc/usr/share/doc/trove-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif

override_dh_install:
	dh_install -O--buildsystem=python_distutils --fail-missing
	set -e && for pyvers in $(PYTHONS); do \
		python$$pyvers setup.py install --install-layout=deb \
			--root $(CURDIR)/debian/python-trove; \
	done
	# Install the config files in the different binary packages
	# -guestagent
	install -D -m 0664 $(CURDIR)/etc/trove/trove-guestagent.conf.sample $(CURDIR)/debian/trove-common/usr/share/trove-common/trove-guestagent.conf
	# -taskmanager
	install -D -m 0664 $(CURDIR)/etc/trove/trove-taskmanager.conf.sample $(CURDIR)/debian/trove-common/usr/share/trove-common/trove-taskmanager.conf
	# -conductor
	install -D -m 0664 $(CURDIR)/etc/trove/trove-conductor.conf.sample $(CURDIR)/debian/trove-common/usr/share/trove-common/trove-conductor.conf
	# -common
	install -D -m 0664 $(CURDIR)/etc/trove/trove.conf.sample $(CURDIR)/debian/trove-common/usr/share/trove-common/trove.conf
	# We want neutron by default, not nova-network
	pkgos-fix-config-default $(CURDIR)/debian/trove-common/usr/share/trove-common/trove.conf DEFAULT network_driver	trove.network.neutron.NeutronDriver

	# Use nova config drive by default
	pkgos-fix-config-default $(CURDIR)/debian/trove-common/usr/share/trove-common/trove-taskmanager.conf DEFAULT use_nova_server_config_drive True

	install -D -m 0664 $(CURDIR)/etc/trove/api-paste.ini $(CURDIR)/debian/trove-common/usr/share/trove-common/api-paste.ini

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` ; \
		PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit '(?!(.*guestagent\.test_dbaas\.MySqlAppTest\.test__wait_for_slave_status.*|.*taskmanager\.test_models\.BuiltInstanceTasksTest\.test_error_attach_replica.*))' | tee $$TEMP_REZ | subunit2pyunit ; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
		rm -f $$TEMP_REZ ; \
		testr-python$$PYMAJOR slowest ; \
	done
endif