|
| 1 | +#!/usr/bin/make -f |
| 2 | +# -*- makefile -*- |
| 3 | + |
| 4 | +# Uncomment this to turn on verbose mode. |
| 5 | +#export DH_VERBOSE=1 |
| 6 | + |
| 7 | +PY3VERS := $(shell py3versions -vs) |
| 8 | +PY3VER := $(shell py3versions -vd) |
| 9 | + |
| 10 | +include /usr/share/dpkg/pkg-info.mk |
| 11 | + |
| 12 | +include /usr/share/python3/python.mk |
| 13 | + |
| 14 | +# Some locales trigger reproducibility issues in html documentation |
| 15 | +export LC_ALL=C.UTF-8 |
| 16 | +export LANG=C.UTF-8 |
| 17 | + |
| 18 | +prebuild: prebuild-stamp |
| 19 | +prebuild-stamp: |
| 20 | + touch $@ |
| 21 | + |
| 22 | +build-arch: build |
| 23 | +build-indep: build |
| 24 | +build: build3-stamp |
| 25 | + |
| 26 | +build3-stamp: $(PY3VERS:%=build3-python%) doc-build3-python$(PY3VER) |
| 27 | + touch $@ |
| 28 | +build3-python%: prebuild |
| 29 | + python$* setup.py build |
| 30 | + touch $@ |
| 31 | +doc-build3-python$(PY3VER): build3-python$(PY3VER) |
| 32 | + touch $@ |
| 33 | + |
| 34 | +clean: |
| 35 | + dh_testdir |
| 36 | + dh_testroot |
| 37 | + rm -f build*-stamp build*-python* dbg-build*-python* prebuild-stamp |
| 38 | + rm -rf build dist __pycache__ |
| 39 | + -find -name '*.py[co]' | xargs rm -f |
| 40 | + rm -rf [23].[0-9] |
| 41 | + dh_clean |
| 42 | + |
| 43 | +install: build install-prereq $(PY3VERS:%=install3-python%) |
| 44 | + -find debian -name '*.py[co]' | xargs rm -f |
| 45 | + -find debian -name __pycache__ | xargs rm -rf |
| 46 | + rm -rf debian/python*-mavproxy/usr/lib/python |
| 47 | + |
| 48 | +install-prereq: |
| 49 | + dh_testdir |
| 50 | + dh_testroot |
| 51 | + dh_prep |
| 52 | + |
| 53 | +install3-python%: |
| 54 | + mkdir -p debian/python3-mavproxy/usr/bin |
| 55 | + mkdir -p debian/python3-mavproxy/$(call py_libdir, $*) |
| 56 | + python$* setup.py install \ |
| 57 | + --root=$(CURDIR)/debian/python3-mavproxy --install-layout=deb |
| 58 | + |
| 59 | +# Build architecture-independent files here. |
| 60 | +binary-indep: build install |
| 61 | + dh_testdir |
| 62 | + dh_testroot |
| 63 | + dh_installchangelogs -i |
| 64 | + dh_installdocs -i |
| 65 | + dh_installexamples -i samples/* |
| 66 | + dh_compress -i -X.xml -X.py \ |
| 67 | + -X.html -X.css -X.asc -X.png -Xapi-objects.txt |
| 68 | + dh_fixperms -i |
| 69 | + dh_installdeb -i |
| 70 | + dh_shlibdeps -i |
| 71 | + dh_gencontrol -i |
| 72 | + dh_md5sums -i |
| 73 | + dh_builddeb -i |
| 74 | + |
| 75 | +# Build architecture-dependent files here. |
| 76 | +binary-arch: build install |
| 77 | + dh_testdir |
| 78 | + dh_testroot |
| 79 | +# dh_installchangelogs -a CHANGES.txt |
| 80 | +# dh_installdocs -a CREDITS.txt README.rst TODO.txt |
| 81 | + dh_installdocs -a README.md |
| 82 | +# dh_installexamples -a examples/* |
| 83 | + dh_python3 -a |
| 84 | + dh_strip -ppython3-mavproxy |
| 85 | + dh_compress -a -X.xml -X.py \ |
| 86 | + -X.html -X.css -X.asc -X.png -Xapi-objects.txt |
| 87 | + dh_fixperms -a |
| 88 | + dh_installdeb -a |
| 89 | + dh_shlibdeps -a |
| 90 | + dh_gencontrol -a |
| 91 | + dh_md5sums -a |
| 92 | + dh_builddeb -a |
| 93 | + |
| 94 | +binary: binary-indep binary-arch |
| 95 | +.PHONY: build clean binary-indep binary-arch binary install |
0 commit comments