summaryrefslogtreecommitdiff
path: root/debian/rules
blob: ae18f180eed16b791251a33978f965ae4777d73e (plain)
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
#!/usr/bin/make -f

export DH_VERBOSE=1
export PYBUILD_NAME=fabio

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_clean:
        # remove the cython generated files distributed by upstream
	rm -f $(patsubst %.pyx,%.c,$(wildcard fabio/ext/*.pyx))
	rm -rf doc/build/html
	rm -rf build/man
	rm -rf *.egg-info

override_dh_auto_build-arch:
	PYBUILD_BUILD_ARGS="-Ccompile-args=--verbose" dh_auto_build

override_dh_auto_build-indep: override_dh_auto_build-arch
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	dh_auto_build -- -s custom --build-args="cd doc && PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' {interpreter} -m sphinx -N -bhtml source build/html"
endif

override_dh_auto_test:
#       https://github.com/silx-kit/fabio/issues/153
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' FABIO_TESTIMAGES=testimages xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} ./run_tests.py" dh_auto_test

execute_after_dh_auto_install-indep:
        # install scripts into fabio-viewer
	dh_install -p fabio-viewer debian/python3-fabio/usr/bin /usr
	rm -rf debian/python3-fabio/usr/bin

execute_after_dh_installdocs:
	dh_installdocs -p python-fabio-doc "doc/build/html" --doc-main-package=python3-fabio

execute_after_dh_link:
	dh_link -p python-fabio-doc /usr/share/javascript/mathjax /usr/share/doc/python-fabio/html/_static/mathjax

override_dh_sphinxdoc:
	dh_sphinxdoc -p python-fabio-doc -X_static/mathjax -O--buildsystem=pybuild

execute_before_dh_fixperms:
	# hack until the 1/1/1970 issue is solved by upstream
	-find debian/fabio-viewer -type f | xargs touch -d@${SOURCE_DATE_EPOCH}
	-find debian/python3-fabio -type f | xargs touch -d@${SOURCE_DATE_EPOCH}
	-find debian/python-fabio-doc -type f | xargs touch -d@${SOURCE_DATE_EPOCH}