File: rules

package info (click to toggle)
python-jsonschema 2.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 936 kB
  • sloc: python: 3,064; makefile: 154; sh: 34
file content (42 lines) | stat: -rwxr-xr-x 1,360 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
#!/usr/bin/make -f

PYTHON3:=$(shell py3versions -r)
py3sdo=set -ex; $(foreach py, $(PYTHON3), $(py) $(1);)

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

export PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)

%:
	dh $@ --with python2,python3,sphinxdoc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -e ; for i in 2.7 $(PYTHON3S) ; do \
		PYTHON=python$$i python$$i -m nose -v ; \
	done
endif

override_dh_auto_build:
	echo $$PACKAGE_VERSION  | sed s/\\./-/g >version.txt
	dh_auto_build
	$(call py3sdo, setup.py build)

override_dh_auto_install:
	pkgos-dh_auto_install

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

override_dh_auto_clean:
	echo $$PACKAGE_VERSION  | sed s/\\./-/g >version.txt
	#http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 dh_auto_clean
	rm -rf build version.txt
	rm -rf __pycache__

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 PYTHONPATH=$(CURDIR) PYTHON=python3 python3 -m sphinx $(SPHINXOPTS) -b html docs $(CURDIR)/debian/python-jsonschema-doc/usr/share/doc/python-jsonschema-doc/html
	dh_sphinxdoc
endif