File: rules

package info (click to toggle)
sahara 1%3A9.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,972 kB
  • sloc: python: 61,619; xml: 38,235; sh: 2,168; makefile: 78; sql: 46
file content (99 lines) | stat: -rwxr-xr-x 4,187 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/make -f

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

LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
BUILD_DATE  = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
SPHINXOPTS := -D html_last_updated_fmt="$(BUILD_DATE)"

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

override_dh_clean:
	rm -rf build 	debian/sahara-common.postinst \
			debian/sahara-common.config \
			debian/sahara-api.postinst \
			debian/sahara-api.config
	rm -rf doc/build
	rm -f debian/*.init debian/*.service debian/*.upstart
	dh_clean -O--buildsystem=python_distutils

override_dh_auto_clean:
	python3 setup.py clean

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

override_dh_auto_install:
	echo "Do nothing..."

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

	rm -rf $(CURDIR)/debian/tmp/usr/etc

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	# Blacklisted. See https://storyboard.openstack.org/#!/story/2003674
	pkgos-dh_auto_test --no-py2 'sahara\.tests\.unit(?!(.*utils\.test_crypto\.CryptoTest\.test_to_paramiko_private_key.*|.*utils\.test_crypto.CryptoTest\.test_generate_key_pair.*))'
endif

	# Install the config files.
	mkdir -p $(CURDIR)/debian/sahara-common/usr/share/sahara-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--wrap-width 140 \
		--namespace sahara.config \
		--namespace keystonemiddleware.auth_token \
		--namespace oslo.concurrency \
		--namespace oslo.db \
		--namespace oslo.log \
		--namespace oslo.messaging \
		--namespace oslo.middleware.cors \
		--namespace oslo.middleware.http_proxy_to_wsgi \
		--namespace oslo.policy \
		--namespace oslo.service.periodic_task \
		--namespace oslo.service.sslutils \
		--namespace oslo.service.wsgi \
		--output-file $(CURDIR)/debian/sahara-common/usr/share/sahara-common/sahara.conf
	pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/sahara-common/usr/share/sahara-common/sahara.conf keystone_authtoken sahara

	pkgos-fix-config-default $(CURDIR)/debian/sahara-common/usr/share/sahara-common/sahara.conf database connection sqlite:///var/lib/sahara/saharadb
	pkgos-fix-config-default $(CURDIR)/debian/sahara-common/usr/share/sahara-common/sahara.conf oslo_concurrency lock_path /var/lock/sahara
	pkgos-fix-config-default $(CURDIR)/debian/sahara-common/usr/share/sahara-common/sahara.conf keystone_authtoken auth_protocol http

	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslopolicy-sample-generator \
		--output-file $(CURDIR)/debian/sahara-common/usr/share/sahara-common/policy.json \
		--format json \
		--namespace sahara

	mkdir -p $(CURDIR)/debian/sahara-common/etc/sahara
	cp etc/sahara/compute.topology.sample $(CURDIR)/debian/sahara-common/etc/sahara/compute.topology
	cp etc/sahara/swift.topology.sample $(CURDIR)/debian/sahara-common/etc/sahara/swift.topology
	set -e ; for i in api-paste.ini rootwrap.conf rootwrap.d ; do \
		cp -rfv etc/sahara/$$i $(CURDIR)/debian/sahara-common/etc/sahara ; \
	done

	dh_install
	dh_missing --fail-missing

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

override_dh_installman:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. python3 -m sphinx $(SPHINXOPTS) -b man doc/source doc/build/man
	dh_installman -O--buildsystem=python_distutils
endif

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