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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#!/usr/bin/make -f
export DH_VERBOSE=1
export HOME=/tmp
export SPECFILE_USE_GNU_SOURCE=1
export WITH_CYTHON=1
export WITH_GUI=1
export QHULL_CFLAGS=-I/usr/include/qhull
export QHULL_LIBS=-lqhull
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)
# 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 *
%:
dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
override_dh_clean:
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
override_dh_installchangelogs:
dh_installchangelogs changelog.txt
override_dh_install:
dh_install -O--buildsystem=pybuild
# 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
# 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/
dh_numpy
dh_numpy3
override_dh_auto_test:
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="cd {build_dir} && PYMCA_DATA_DIR=$(PYMCA_DATA_DIR_TEST) PYMCA_DOC_DIR=$(PYMCA_DOC_DIR_TEST) {interpreter} PyMca5/tests/TestAll.py" dh_auto_test
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYBUILD_SYSTEM=custom \
PYBUILD_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" dh_auto_build # HTML generator
dh_installdocs "doc/build/html" -p pymca-doc
dh_sphinxdoc -O--buildsystem=pybuild
endif
|