File: rules

package info (click to toggle)
vitrage 3.2.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,068 kB
  • sloc: python: 30,840; sh: 483; makefile: 62
file content (80 lines) | stat: -rwxr-xr-x 3,343 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
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f

include /usr/share/openstack-pkg-tools/pkgos.make

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

override_dh_auto_clean:
	python3 setup.py clean

override_dh_clean:
	dh_clean
	find . -iname '*.pyc' -delete
	find . -name '*.db' -delete
	rm -rf .eggs
	rm -rf build
	rm -f ChangeLog AUTHORS
	rm -f doc/source/_static/vitrage.conf.sample
	rm -f etc/vitrage/policy.yaml.sample
	rm -f debian/vitrage-common.postinst debian/vitrage-common.config debian/vitrage-api.config debian/vitrage-api.postinst debian/vitrage-common.postrm
	rm -f debian/*.templates
	rm -f debian/*.init debian/*.upstart debian/*.service debian/*.templates

override_dh_auto_build:
	set -e ; for i in $(PYTHON3S) ; do \
		python3 setup.py build --force ; \
	done

	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func vitrage-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func vitrage-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func vitrage-api.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func vitrage-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm vitrage-common.postrm
	pkgos-merge-templates vitrage-api vitrage endpoint
	pkgos-merge-templates vitrage-common vitrage db rabbit ksat

override_dh_auto_test:
	echo "Do nothing..."

override_dh_auto_install:
	echo "Do nothing..."

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3

override_dh_install:
	for i in $(PYTHON3S) ; do \
		python$$i setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp ; \
	done

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	pkgos-dh_auto_test --no-py2 --no-parallel 'vitrage\.tests\.unit(?!(.*evaluator\.test_scenario_repository\.ScenarioRepositoryTest.*|.*evaluator\.test_scenario_repository\.RegExTemplateTest\.test_regex_with_exact_match.*))'
endif

	# Generate configs
	mkdir -p $(CURDIR)/debian/vitrage-common/usr/share/vitrage-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--config-file $(CURDIR)/etc/vitrage/vitrage-config-generator.conf \
	        --output-file $(CURDIR)/debian/vitrage-common/usr/share/vitrage-common/vitrage.conf \
	        --wrap-width 140
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \
		--config-file $(CURDIR)/etc/vitrage/vitrage-policy-generator.conf \
		--output-file $(CURDIR)/debian/vitrage-common/usr/share/vitrage-common/policy.json \
		--format json
	pkgos-fix-config-default $(CURDIR)/debian/vitrage-common/usr/share/vitrage-common/vitrage.conf oslo_concurrency lock_path /var/lock/vitrage

	mkdir -p $(CURDIR)/debian/vitrage-common/etc/vitrage/datasources_values
	mkdir -p $(CURDIR)/debian/vitrage-common/etc/vitrage/static_datasources
	cp -av $(CURDIR)/etc/vitrage/api-paste.ini $(CURDIR)/debian/vitrage-common/usr/share/vitrage-common/api-paste.ini
	cp -av $(CURDIR)/etc/vitrage/datasources_values/* $(CURDIR)/debian/vitrage-common/etc/vitrage/datasources_values/


	dh_install
	dh_missing --fail-missing

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHON=python3 python3 -m sphinx $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/vitrage-doc/usr/share/doc/vitrage-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif