File: rules

package info (click to toggle)
freezer-api 9.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,884 kB
  • sloc: python: 15,677; sh: 388; makefile: 56
file content (78 lines) | stat: -rwxr-xr-x 2,510 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
#!/usr/bin/make -f

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

FREEZER_API_CONF=$(CURDIR)/debian/freezer-api/usr/share/freezer-api/freezer-api.conf

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

override_dh_auto_clean:
	python3 setup.py clean
	rm -f debian/*.init debian/*.upstart debian/*.service debian/*.templates
	rm -rf .testrepository
	rm -f .coverage
	rm -rf cover
	rm -rf *egg-info
	find .  -type d -name __pycache__ -exec rm -r {} \+
	find . -type f -name "*.py[c|o]" -delete

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

override_dh_auto_test:
	echo "Do nothing..."

override_dh_auto_install:
	echo "Doing nothing..."

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

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	@echo "===> Running tests"
	pkgos-dh_auto_test --no-py2 'freezer_api.tests.unit'

endif

	# Generate configs
	mkdir -p $(CURDIR)/debian/freezer-api/usr/share/freezer-api
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
		--output-file=$(FREEZER_API_CONF) \
		--wrap-width 140 \
		--namespace freezer-api \
		--namespace oslo.db \
		--namespace oslo.log \
		--namespace oslo.middleware \
		--namespace oslo.policy \

	# Re-add missing options
	pkgos-readd-keystone-authtoken-missing-options $(FREEZER_API_CONF) keystone_authtoken freezer


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

	# Fix config default values
	pkgos-fix-config-default $(FREEZER_API_CONF) storage backend sqlalchemy
	pkgos-fix-config-default $(FREEZER_API_CONF) storage driver sqlalchemy

	dh_install
	dh_missing --fail-missing

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHON=python3 python3 -m sphinx -b html api-ref/source $(CURDIR)/debian/freezer-api-doc/usr/share/doc/freezer-api-doc/html
	dh_sphinxdoc
endif

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