File: rules

package info (click to toggle)
murano 1%3A10.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 10,632 kB
  • sloc: python: 34,171; sh: 752; pascal: 269; makefile: 83
file content (108 lines) | stat: -rwxr-xr-x 4,649 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
100
101
102
103
104
105
106
107
108
#!/usr/bin/make -f

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

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

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

override_dh_clean:
	rm -rf 	build \
	 	debian/murano-common.postinst \
		debian/murano-common.config \
		debian/murano-api.postinst \
		debian/murano-api.config \
		debian/murano-common.postrm \
		doc/build/man
	rm -f debian/*.init debian/*.service debian/*.upstart
	dh_clean
	rm -rf debian/*.templates debian/po

override_dh_auto_clean:
	python3 setup.py clean

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

override_dh_auto_install:
	echo "Do nothing..."

override_dh_auto_test:
	echo "Do nothing..."

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)))
	DISCOVER_DIRECTORY=$(CURDIR)/murano/tests/unit pkgos-dh_auto_test --no-py2 'tests\.unit\.(?!(.*SysLogHandlersTestCase.*|.*packages\.hot_package\.test_hot_package\.TestHotPackage\.test_heat_files_generated.*|.*common\.test_wsgi\.TestXMLDictSerializer\.test_XML_Dict_Serializer_create_link_nodes.*|.*engine\.test_package_loader\.TestCombinedPackageLoader\.test_export_fixation_table.*|.*api.cmd\.test_test_runner\.TestCaseShell\.test_help.*))'
endif

	# Get the main config file to use decent defaults.
	mkdir -p $(CURDIR)/debian/murano-common/usr/share/murano-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--output-file $(CURDIR)/debian/murano-common/usr/share/murano-common/murano.conf \
		--wrap-width 140 \
		--namespace keystone_authtoken \
		--namespace murano \
		--namespace oslo.db \
		--namespace oslo.log \
		--namespace oslo.messaging \
		--namespace oslo.middleware.cors \
		--namespace oslo.policy \
		--namespace oslo.service.service \
		--namespace castellan.config
	pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/murano-common/usr/share/murano-common/murano.conf keystone_authtoken murano

	sed -i 's|^[# \t]*notification_driver[ \t]*=.*|notification_driver=messagingv2|' $(CURDIR)/debian/murano-common/usr/share/murano-common/murano.conf
	sed -i 's|#connection=<None>|connection=sqlite:///var/lib/murano/muranodb|' $(CURDIR)/debian/murano-common/usr/share/murano-common/murano.conf

	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--output-file $(CURDIR)/debian/murano-common/usr/share/murano-common/murano-cfapi.conf \
		--wrap-width 140 \
		--namespace keystone_authtoken \
		--namespace murano.cfapi \
		--namespace oslo.db \
		--namespace oslo.log

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

	dh_install
	rm -rf $(CURDIR)/debian/tmp/usr/etc
	dh_missing --fail-missing

	# Install config files
	for i in murano-cfapi-paste.ini murano-paste.ini ; do \
		cp $(CURDIR)/etc/murano/$$i $(CURDIR)/debian/murano-common/usr/share/murano-common ; \
	done
	cp $(CURDIR)/etc/murano/logging.conf.sample $(CURDIR)/debian/murano-common/usr/share/murano-common/logging.conf

	# Zip the murano core-library and push it in the package.
	# Note that this is done in a reproducible way, adjusting timestamps
	# before zipping the files.
	find meta/io.murano -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	cd meta/io.murano ; TZ=UTC zip -r ../../debian/murano-common/usr/share/murano-common/io.murano.zip * ; cd ../..

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	if ! PYTHONPATH=. python3 -m sphinx $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/murano-doc/usr/share/doc/murano-doc/html ; then \
		cat /tmp/sphinx-err* ; \
		exit 1 ; \
	fi
	dh_sphinxdoc -O--buildsystem=python_distutils
endif

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