File: rules

package info (click to toggle)
freezer 13.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,164 kB
  • sloc: python: 13,520; sh: 148; makefile: 46
file content (66 lines) | stat: -rwxr-xr-x 2,120 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
#!/usr/bin/make -f

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

FREEZER_SCHEDULER_CONF=$(CURDIR)/debian/freezer-scheduler/usr/share/freezer-scheduler/freezer-scheduler.conf

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

override_dh_auto_clean:
	python3 setup.py clean
	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-scheduler.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func freezer-scheduler.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm freezer-scheduler.postrm

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.tests.unit'

endif

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

	# Re-add missing options
	pkgos-add-missing-options $(FREEZER_SCHEDULER_CONF) DEFAULT debian/freezer-scheduler-conf-missing-options

	# Fix config default values
	pkgos-fix-config-default $(FREEZER_SCHEDULER_CONF) DEFAULT log_dir /var/log/freezer
	pkgos-fix-config-default $(FREEZER_SCHEDULER_CONF) DEFAULT log_file freezer-scheduler.log

	dh_install
	dh_missing --fail-missing

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

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