#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) # Cfr. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773266 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_OPTIONS += partialcheck export DEB_BUILD_MAINT_OPTIONS=hardening=+all override_dh_auto_configure: # echo "DEB_HOST_MULTIARCH = ${DEB_HOST_MULTIARCH}" # echo "DEB_HOST_GNU_TYPE = ${DEB_HOST_GNU_TYPE}" dh_auto_configure -- -DCMAKE_INSTALL_LIBDIR=lib/${DEB_HOST_MULTIARCH} \ -DENABLE_XHOST=OFF \ -DBUILD_SPHINX=$(if $(filter chemps2-doc,$(shell dh_listpackages)),ON,OFF) \ -DHDF5_INCLUDE_DIRS=/usr/include/hdf5/serial \ -DCMAKE_BUILD_TYPE=release override_dh_auto_build: dh_auto_build -- VERBOSE=1 cd PyCheMPS2 && CPATH=../CheMPS2/include:/usr/include/hdf5/serial python3 setup.py build_ext -L ../obj-${DEB_HOST_GNU_TYPE}/CheMPS2 execute_after_dh_auto_build-indep: # https://wiki.debian.org/Python/LibraryStyleGuide: info on sphinx-build PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -b html \ -c obj-${DEB_HOST_GNU_TYPE}/sphinx/ \ -D html_theme=default \ -D mathjax_path="/usr/share/javascript/mathjax/MathJax.js" sphinx/ build-sphinx/html # I know it's ugly, but sphinx splits strings at equality signs: http://svn.python.org/projects/doctools/trunk/sphinx/cmdline.py cd build-sphinx/html && sed -i "s/MathJax.js/MathJax.js?config=TeX-AMS-MML_HTMLorMML/" *.html # Solving the complaints from lintian about jquery.js & underscore.js cd build-sphinx/html && sed -i "s/_static\/jquery.js/\/usr\/share\/javascript\/jquery\/jquery.js/" *.html cd build-sphinx/html && sed -i "s/_static\/underscore.js/\/usr\/share\/javascript\/underscore\/underscore.js/" *.html cd build-sphinx/html/_static && rm jquery*.js underscore*.js override_dh_auto_install: dh_auto_install # This will skip the build as it is already performed cd PyCheMPS2 && CPATH=../CheMPS2/include:/usr/include/hdf5/serial python3 setup.py install --root=../debian/tmp --install-layout=deb dh_numpy3 override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # nocheck NOT in variable ifeq (,$(filter fullcheck,$(DEB_BUILD_OPTIONS))) # fullcheck NOT in variable cd obj-${DEB_HOST_GNU_TYPE}/ && ctest -R "^test3|^test5|^test8" else dh_auto_test endif #Just check if the first python test works: python and c++ tests are identical cd PyCheMPS2/tests && PYTHONPATH=../../$(shell find -name lib.*):.. \ LD_LIBRARY_PATH=../../obj-${DEB_HOST_GNU_TYPE}/CheMPS2:/usr/lib/${DEB_HOST_MULTIARCH}/hdf5/serial \ python3 test1.py else echo "DEB_BUILD_OPTIONS contains nocheck: no tests will be performed." endif # Now handled by debian/chemps2.manpages #override_dh_installman: # dh_installman chemps2.1 override_dh_installchangelogs: dh_installchangelogs -k CHANGELOG.md override_dh_clean: dh_clean rm -rf build-sphinx PyCheMPS2/build PyCheMPS2/PyCheMPS2.cpp PyCheMPS2/*.pyc %: dh $@ --with python3