File: rules

package info (click to toggle)
ironic 1:16.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 16,368 kB
  • sloc: python: 134,939; sh: 2,995; pascal: 644; xml: 376; makefile: 76
file content (108 lines) | stat: -rwxr-xr-x 5,268 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

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

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

override_dh_auto_clean:
	python3 setup.py clean
	rm -f debian/ironic-common.config debian/ironic-common.postinst debian/ironic-api.postinst debian/ironic-api.config
	rm -rf doc/build
	rm -f debian/*.init debian/*.service debian/*.upstart

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

override_dh_auto_test:
	echo "Do nothing..."

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)))
	pkgos-dh_auto_test --no-py2 'ironic\.tests\.unit\.(?!(.*api\.controllers\.v1\.test_chassis\.TestPost\.test_create_chassis_unicode_description.*))'
endif

	mkdir -p $(CURDIR)/debian/ironic-common/usr/share/ironic-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--output-file $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf \
		--wrap-width 140 \
		--namespace ironic \
		--namespace ironic_lib.disk_utils \
		--namespace ironic_lib.disk_partitioner \
		--namespace ironic_lib.exception \
		--namespace ironic_lib.mdns \
		--namespace ironic_lib.metrics \
		--namespace ironic_lib.metrics_statsd \
		--namespace ironic_lib.utils \
		--namespace oslo.db \
		--namespace oslo.messaging \
		--namespace oslo.middleware.cors \
		--namespace oslo.middleware.healthcheck \
		--namespace oslo.middleware.http_proxy_to_wsgi \
		--namespace oslo.concurrency \
		--namespace oslo.policy \
		--namespace oslo.log \
		--namespace oslo.reports \
		--namespace oslo.service.service \
		--namespace oslo.service.periodic_task \
		--namespace oslo.service.sslutils \
		--namespace osprofiler \
		--namespace keystonemiddleware.auth_token

	pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf keystone_authtoken ironic
	# We're using python3, the default isn't good, it's using py2.
	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT pybasedir /usr/lib/python3/site-packages/ironic

	# Fix the default httpboot path, some of it is in the postinst
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf deploy http_root /var/lib/ironic/httpboot

	# Set some nice defaults
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT enabled_boot_interfaces pxe
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT enabled_deploy_interfaces iscsi,direct
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT default_deploy_interface direct
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT enabled_inspect_interfaces inspector
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf DEFAULT default_network_interface neutron
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf oslo_concurrency lock_path /var/lock/ironic
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf pxe tftp_root /srv/tftp
#	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf pxe ipxe_enabled true

	mkdir -p $(CURDIR)/debian/ironic-common/etc/ironic/policy.d
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \
		--output-file $(CURDIR)/debian/ironic-common/etc/ironic/policy.d/00_default_policy.yaml \
		--format yaml \
		--namespace ironic.api
	# Fixed using /etc/ironic/policy.d
	pkgos-fix-config-default $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf oslo_policy policy_dirs /etc/ironic/policy.d

	sed -i 's|#connection=<None>|connection=sqlite:////var/lib/ironic/ironicdb|' $(CURDIR)/debian/ironic-common/usr/share/ironic-common/ironic.conf

	dh_install
	dh_missing --fail-missing

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	if ! PYTHONPATH=$(CURDIR) PYTHON=python3 python3 -m sphinx -a -b html doc/source $(CURDIR)/debian/ironic-doc/usr/share/doc/ironic-doc/html ; then \
		cat /tmp/sphinx-err* ; \
		exit 1 ; \
	fi
	mkdir -p $(CURDIR)/debian/ironic-doc/usr/share/doc/ironic-doc/html/_static
	touch $(CURDIR)/debian/ironic-doc/usr/share/doc/ironic-doc/html/_static/toggle.js
	#rm $(CURDIR)/debian/ironic-doc/usr/share/doc/ironic-doc/html/search.html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif

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