#!/usr/bin/make -f export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS=hardening=+all export HOME=/tmp export LIBGL_ALWAYS_INDIRECT=1 export SPECFILE_USE_GNU_SOURCE=1 export WITH_CYTHON=1 export WITH_GUI=1 export QHULL_CFLAGS=-I/usr/include/libqhull_r export QHULL_LIBS=-lqhull_r export PYMCA_DATA_DIR=/usr/share/pymca export PYMCA_DOC_DIR=$(PYMCA_DATA_DIR)/doc export PYMCA_DATA_DIR_TEST=$(CURDIR)/PyMca5/PyMcaData/ export PYMCA_DOC_DIR_TEST=$(PYMCA_DATA_DIR_TEST) export PYBUILD_NAME=pymca5 export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/bin/ {destdir}/usr/share/man {destdir}$(PYMCA_DATA_DIR) # get the default python3 interpreter version PY3VER := $(shell py3versions -dv) # Make does not offer a recursive wildcard function, so here's one: rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) # How to recursively find all files with the same name in a given folder ALL_PYX := $(call rwildcard,PyMca5/,*.pyx) #NOTA: No space before * # skip OpenGL tests on these architectures # - OpenGL is not available on armhf ARCH_SKIP_OPENGL_TEST_LIST = armhf empty := space := $(empty)$(empty) ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_SKIP_OPENGL_TEST_LIST)$(space))) export WITH_OPENGL_TEST=False endif %: dh $@ --buildsystem=pybuild execute_after_dh_clean: # remove the cython generated file to force rebuild rm -f $(patsubst %.pyx,%.cpp,${ALL_PYX}) rm -f $(patsubst %.pyx,%.c,${ALL_PYX}) rm -f $(patsubst %.pyx,%.html,${ALL_PYX}) rm -rf *.egg-info # remove the built documentation rm -rf doc/build # remove a.out generated by configuration rm -rf a.out execute_after_dh_auto_build: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) pybuild --build -s custom -p $(PY3VER) --build-args="cd doc && PYTHONPATH={build_dir} PYMCA_DATA_DIR=$(PYMCA_DATA_DIR_TEST) PYMCA_DOC_DIR=$(PYMCA_DOC_DIR_TEST) http_proxy='127.0.0.1:9' {interpreter} -m sphinx -N -bhtml source build/html" endif override_dh_installchangelogs: dh_installchangelogs changelog.txt execute_after_dh_install: # pymca python3 setup.py install_scripts -d debian/pymca/usr/bin python3 setup.py install_man -d debian/pymca/usr/share/man dh_install -p pymca package/desktop/*.desktop usr/share/applications dh_install -p pymca package/desktop/PyMca.png usr/share/icons/hicolor/256x256/apps dh_install -p pymca package/desktop/pymca.xml usr/share/mime/packages dh_install -p pymca package/desktop/*.metainfo2.xml usr/share/metainfo # pymca-data python3 setup.py install_data --root debian/pymca-data/ rm -f debian/pymca-data/usr/share/pymca/EPDL97/LICENSE rm -f debian/pymca-data/usr/share/pymca/LICENSE rm -f debian/pymca-data/usr/share/pymca/LICENSE.GPL rm -f debian/pymca-data/usr/share/pymca/LICENSE.LGPL rm -f debian/pymca-data/usr/share/pymca/LICENSE.MIT rm -rf debian/pymca-data/usr/share/pymca/doc/HTML/PyMCA_files/ execute_after_dh_installdocs: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) dh_installdocs -p pymca-doc "doc/build/html" endif override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) pybuild --test -s custom -p $(PY3VER) --test-args="cd {build_dir} && PYMCA_DATA_DIR=$(PYMCA_DATA_DIR_TEST) PYMCA_DOC_DIR=$(PYMCA_DOC_DIR_TEST) xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} PyMca5/tests/TestAll.py" endif override_dh_python3: dh_python3 --shebang=/usr/bin/python3