File: rules

package info (click to toggle)
veusz 3.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,820 kB
  • sloc: python: 41,892; cpp: 11,272; javascript: 9,202; ansic: 1,256; makefile: 247; xml: 79
file content (73 lines) | stat: -rwxr-xr-x 2,252 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
#!/usr/bin/make -f

export CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
export QT_SELECT := qt5

# Get the supported Python versions
PY3VERS = $(shell py3versions -r -v)

# Callable functions to determine the correct PYTHONPATH
# (pyinstaller moved from pythonX.Y ->cpython[23] - this is for compatibility)
pythonpath = $$(ls -d $(CURDIR)/.pybuild/pythonX.Y_$(1)/build \
	$(CURDIR)/.pybuild/cpython3_$(1)/build)

# examples are not installed, but included manually in package
export PYBUILD_INSTALL_ARGS = \
	--veusz-resource-dir=debian/tmp/usr/share/veusz \
	--disable-install-examples
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build: delete_generated
	dh_auto_build

# desktop files are copied from source package
	cp -p support/veusz.desktop debian/
	cp -p support/veusz.xml debian/veusz.sharedmimeinfo

# regenerate docs
	http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 PYTHONPATH=. \
		sphinx-build -N -bhtml Documents/manual-source build/html
	pod2man --release=`cat VERSION` --center="Veusz"  Documents/man-page/veusz.pod build/veusz.1

execute_after_dh_auto_install:
# do not install examples and put data files in /usr/share/veusz

# veusz follows symlink to find its resources
	for py in $(PY3VERS); do \
		dh_link -ppython3-veusz usr/share/veusz usr/lib/python$${py}/dist-packages/veusz/resources; \
	done
# COPYING is symlinked in veusz package
	rm -f debian/tmp/usr/share/veusz/COPYING

	dh_numpy3

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -e -x;\
	for py in $(PY3VERS); do \
		PYTHONPATH=$(call pythonpath,$$py) \
			VEUSZ_RESOURCE_DIR=. \
			QT_QPA_PLATFORM=minimal \
			python$$py tests/runselftest.py ;\
	done
endif

# don't compress Veusz example files
override_dh_compress:
	dh_compress -X.vsz -X.csv

# delete generated files before clean
execute_before_dh_clean: delete_generated

# clean up temporary files and python cache
execute_before_dh_missing:
	rm -r `find debian/tmp -name __pycache__`

# delete files generated by rules
delete_generated:
	rm -f debian/veusz.sharedmimeinfo debian/veusz.desktop