File: rules

package info (click to toggle)
ironic-inspector 10.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,548 kB
  • sloc: python: 14,254; sh: 638; makefile: 178
file content (64 lines) | stat: -rwxr-xr-x 2,760 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
#!/usr/bin/make -f

UPSTREAM_GIT = https://github.com/openstack/ironic-inspector.git
include /usr/share/openstack-pkg-tools/pkgos.make

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

override_dh_auto_clean:
	python3 setup.py clean

override_dh_clean:
	dh_clean
	rm -rf build debian/ironic-inspector.postinst debian/ironic-inspector.config debian/ironic-inspector.postrm
	rm -rf debian/*.upstart debian/*.service debian/*.init

override_dh_auto_build:
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ironic-inspector.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func ironic-inspector.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm ironic-inspector.postrm
	pkgos-merge-templates ironic-inspector ironic-inspector db ksat endpoint

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

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	pkgos-dh_auto_test --no-py2 'ironic_inspector\.test\.unit.*'
endif

	mkdir -p $(CURDIR)/debian/ironic-inspector/usr/share/ironic-inspector
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--output-file $(CURDIR)/debian/ironic-inspector/usr/share/ironic-inspector/inspector.conf \
		--namespace ironic_inspector \
		--namespace keystonemiddleware.auth_token \
		--namespace oslo.db \
		--namespace oslo.log \
		--namespace oslo.middleware.cors \
		--namespace oslo.policy
	pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/ironic-inspector/usr/share/ironic-inspector/inspector.conf keystone_authtoken ironic-inspector

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

	sed -i 's|^[ \t#]*connection[ \t]=.*|connection = sqlite:////var/lib/ironic-inspector/inspectordb|' $(CURDIR)/debian/ironic-inspector/usr/share/ironic-inspector/inspector.conf
	install -D -m 0644 rootwrap.conf $(CURDIR)/debian/ironic-inspector/etc/ironic-inspector/rootwrap.conf
	install -D -m 0644 rootwrap.d/ironic-inspector.filters $(CURDIR)/debian/ironic-inspector/etc/ironic-inspector/rootwrap.d/ironic-inspector.filters
	install -D -m 0644 $(CURDIR)/debian/ironic-inspector.sudoers $(CURDIR)/debian/ironic-inspector/etc/sudoers.d/ironic-inspector
	sed -i 's|stack|ironic-inspector|' $(CURDIR)/debian/ironic-inspector/etc/sudoers.d/ironic-inspector

	dh_install
	dh_missing --fail-missing

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