File: rules

package info (click to toggle)
silx 2.2.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,696 kB
  • sloc: python: 119,829; ansic: 5,062; lisp: 4,454; cpp: 883; sh: 286; makefile: 90; xml: 46
file content (81 lines) | stat: -rwxr-xr-x 3,098 bytes parent folder | download | duplicates (2)
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
76
77
78
79
80
81
#!/usr/bin/make -f

export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/bin/
export PYBUILD_NAME=silx
export SPECFILE_USE_GNU_SOURCE=1
export SILX_FULL_INSTALL_REQUIRES=1
export HOME=$(CURDIR)/debian/build
export XDG_CACHE_HOME=$(HOME)/.cache

SCIPY_DATA=$(XDG_CACHE_HOME)/scipy-data

include /usr/share/dpkg/architecture.mk

# 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,silx/,*.pyx)
#NOTA: No space before *

# get the default python3 interpreter version
PY3VER := $(shell py3versions -dv)

%:
	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 doc/build/html
	rm -rf build/man
	rm -rf *.egg-info
	rm -rf $(SCIPY_DATA)

execute_after_dh_auto_build-indep:
	# build man pages
	pybuild --build -s custom -p $(PY3VER) --build-args="env PYTHONPATH={build_dir} {interpreter} tools/build_man_page.py"

	# build the documentation
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	pybuild --build -s custom -p $(PY3VER) --build-args="cd doc && env PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} -m sphinx -N -bhtml source build/html"
endif

execute_before_dh_install:
	# install scripts into silx
	python3 setup.py install_scripts -d debian/silx/usr/bin
	dh_install -p silx package/desktop/*.desktop usr/share/applications
	dh_install -p silx package/desktop/silx.png usr/share/icons/hicolor/48x48/apps
	dh_install -p silx package/desktop/silx.svg usr/share/icons/hicolor/scalable/apps
	dh_install -p silx package/desktop/silx.xml usr/share/mime/packages

	# install the qtdesigner files only for the python3 package
	dh_install -p python3-silx qtdesigner_plugins/*.py /usr/lib/$(DEB_HOST_MULTIARCH)/qt5/plugins/designer/python

# WITH_QT_TEST=False to disable graphical tests
# SILX_OPENCL=False to disable OpenCL tests
# SILX_TEST_LOW_MEM=False to disable tests taking large amount of memory
# GPU=False to disable the use of a GPU with OpenCL test
# WITH_GL_TEST=False to disable tests using OpenGL
override_dh_auto_test:
	# temporary install the scipy dataset before running the test
	pybuild --test -s custom --test-args="mkdir -p {home_dir}/.cache/scipy-data/ && cp debian/dataset-ascent/ascent.dat {home_dir}/.cache/scipy-data/"

	GPU=False WITH_QT_TEST=False SILX_OPENCL=False SILX_TEST_LOW_MEM=False \
	dh_auto_test

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

override_dh_installman:
	dh_installman -p silx build/man/*.1

override_dh_python3:
	-rm -f `find . -name "core"`
	dh_python3 --depends-section=full
	dh_python3 -p python3-silx /usr/lib/$(DEB_HOST_MULTIARCH)/qt5/plugins/designer/python