#!/usr/bin/make -f export CFLAGS=$(shell dpkg-buildflags --get CFLAGS) export CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS) export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS) export QT_SELECT := qt5 # Get the supported Python versions PY3VERS = $(shell py3versions -r -v) # Callable functions to determine the correct PYTHONPATH # (pyinstaller moved from pythonX.Y ->cpython[23] - this is for compatibility) pythonpath = $$(ls -d $(CURDIR)/.pybuild/pythonX.Y_$(1)/build \ $(CURDIR)/.pybuild/cpython3_$(1)/build) # examples are not installed, but included manually in package export PYBUILD_INSTALL_ARGS = \ --veusz-resource-dir=debian/tmp/usr/share/veusz \ --disable-install-examples export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: dh $@ --with python3,sphinxdoc --buildsystem=pybuild override_dh_auto_build: delete_generated dh_auto_build # desktop files are copied from source package cp -p support/veusz.desktop debian/ cp -p support/veusz.xml debian/veusz.sharedmimeinfo # regenerate docs http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 PYTHONPATH=. \ sphinx-build -N -bhtml Documents/manual-source build/html pod2man --release=`cat VERSION` --center="Veusz" Documents/man-page/veusz.pod build/veusz.1 execute_after_dh_auto_install: # do not install examples and put data files in /usr/share/veusz # veusz follows symlink to find its resources for py in $(PY3VERS); do \ dh_link -ppython3-veusz usr/share/veusz usr/lib/python$${py}/dist-packages/veusz/resources; \ done # COPYING is symlinked in veusz package rm -f debian/tmp/usr/share/veusz/COPYING dh_numpy3 override_dh_auto_test: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) set -e -x;\ for py in $(PY3VERS); do \ PYTHONPATH=$(call pythonpath,$$py) \ VEUSZ_RESOURCE_DIR=. \ QT_QPA_PLATFORM=minimal \ python$$py tests/runselftest.py ;\ done endif # don't compress Veusz example files override_dh_compress: dh_compress -X.vsz -X.csv # delete generated files before clean execute_before_dh_clean: delete_generated # clean up temporary files and python cache execute_before_dh_missing: rm -r `find debian/tmp -name __pycache__` # delete files generated by rules delete_generated: rm -f debian/veusz.sharedmimeinfo debian/veusz.desktop