File: rules

package info (click to toggle)
python-bumps 0.7.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,264 kB
  • sloc: python: 22,226; ansic: 4,973; cpp: 4,849; xml: 493; makefile: 163; perl: 108; sh: 101
file content (74 lines) | stat: -rwxr-xr-x 2,480 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
73
74
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie

export PYBUILD_NAME=bumps

export libdir=/usr/lib/bumps/

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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .mplconfig doc/_build doc/api doc/dream doc/tutorial api dream .cache
	rm -f bumps/dream/_compiled.so

override_dh_install:
	dh_install
	mv debian/python-bumps/usr/bin/bumps  debian/python-bumps/usr/bin/bumps2
	find debian/python3-bumps/usr -name __pycache__ -exec rm -rf {} +

override_dh_auto_build-common:
	dh_auto_build

override_dh_auto_build-indep: override_dh_auto_build-common
	PYTHONPATH=. http_proxy='127.0.0.1:9' python3 -m sphinx -N -bhtml     doc/ build/html # HTML generator
	ln -sf /usr/share/javascript/mathjax/ build/html/_static/mathjax
	PYTHONPATH=. http_proxy='127.0.0.1:9' python3 -m sphinx -N -btexinfo  doc/ build/texinfo # texinfo generator

override_dh_auto_build-arch: override_dh_auto_build-common
	(cd bumps/dream && $(CC) compiled.c \
	  $(shell dpkg-buildflags --get CPPFLAGS) \
	  $(shell dpkg-buildflags --get CFLAGS) \
	  $(shell dpkg-buildflags --get LDFLAGS) \
	  -fopenmp -shared -lm -o _compiled.so -fPIC)
	for pybuilddir in .pybuild/cpython*_*_bumps/build/bumps/dream; do \
	  cp bumps/dream/_compiled.so $$pybuilddir; \
	done

# bumps/dream:_compiled.so is hardwired into compiled.py, so don't rename
override_dh_python2:
	dh_python2 --no-ext-rename

override_dh_python3:
	dh_python3 --no-ext-rename

override_dh_auto_install-arch:
	dh_auto_install
	rm debian/python*-bumps/usr/lib/python*/*packages/bumps/dream/*.so
	cp bumps/dream/_compiled.so \
	  debian/bumps-private-libs/usr/lib/bumps/random123_compiled.so

override_dh_installinfo-indep:
	cd build/texinfo; \
	for p in *.png; do mv $$p bumps-$$p; done; \
	sed "s/@image{/@image{bumps-/" -i bumps.texi; \
	makeinfo bumps.texi
	dh_installinfo

override_dh_installman-indep:
	cp debian/bumps.1 debian/bumps2.1
	dh_installman
	rm debian/bumps2.1

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	LC_ALL=C.UTF-8 \
	  PYBUILD_TEST_ARGS_python2="-v --all-modules --with-doctest --doctest-options=+ELLIPSIS,+NORMALIZE_WHITESPACE -edream bumps" \
	  PYBUILD_TEST_ARGS_python3="-v --all-modules --with-doctest --doctest-options=+ELLIPSIS,+NORMALIZE_WHITESPACE -edream bumps" \
	  dh_auto_test
endif