File: rules

package info (click to toggle)
python-gnocchiclient 7.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 948 kB
  • sloc: python: 3,198; makefile: 34; sh: 13
file content (45 lines) | stat: -rwxr-xr-x 1,677 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

UPSTREAM_GIT=https://github.com/gnocchixyz/python-gnocchiclient.git
include /usr/share/openstack-pkg-tools/pkgos.make

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

override_dh_auto_clean:
	rm -rf build

override_dh_auto_build:
	echo "Do nothing..."

override_dh_auto_install:
	pkgos-dh_auto_install --no-py2

	# Generate bash completion
	mkdir -p $(CURDIR)/debian/python3-gnocchiclient/usr/share/bash-completion/completions
	PYTHONPATH=$(CURDIR)/debian/python3-gnocchiclient/usr/lib/python3/dist-packages \
		PATH=$(PATH):$(CURDIR)/debian/python3-gnocchiclient/usr/bin \
		gnocchi complete \
		>$(CURDIR)/debian/python3-gnocchiclient/usr/share/bash-completion/completions/gnocchi
	sed -i 's#complete -F _python3_gnocchi python3-gnocchi#complete -F _python3_gnocchi gnocchi#' \
		$(CURDIR)/debian/python3-gnocchiclient/usr/share/bash-completion/completions/gnocchi

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	set -e ; set -x ; for i in $(PYTHON3S) ; do \
		PYTHON=python$$i PYTHONPATH=. python$$i -m pytest gnocchiclient/tests/unit ; \
	done
endif

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	python3 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
	if ! export LANG=C.UTF-8 && export LC_ALL=C.UTF-8 && PATH=$$PATH:$(CURDIR)/debian/bin PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-gnocchiclient-doc/usr/share/doc/python-gnocchiclient-doc/html ; then \
		cat /tmp/sphinx-err* ; \
		exit 1 ; \
	fi
	dh_sphinxdoc
endif

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