File: rules

package info (click to toggle)
chemps2 1.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,404 kB
  • sloc: cpp: 38,532; python: 1,116; f90: 215; makefile: 45; sh: 23
file content (72 lines) | stat: -rwxr-xr-x 3,284 bytes parent folder | download
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
#!/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=ON \
                             -DHDF5_INCLUDE_DIRS=/usr/include/hdf5/serial \
                             -DCMAKE_BUILD_TYPE=release

override_dh_auto_build:
	dh_auto_build -- VERBOSE=1
	# 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
	cd PyCheMPS2 && CPATH=../CheMPS2/include:/usr/include/hdf5/serial python3 setup.py build_ext -L ../obj-${DEB_HOST_GNU_TYPE}/CheMPS2

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