File: rules

package info (click to toggle)
python-bumps 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,688 kB
  • sloc: python: 24,446; ansic: 4,973; cpp: 4,849; javascript: 639; xml: 493; makefile: 147; perl: 108; sh: 94
file content (55 lines) | stat: -rwxr-xr-x 1,995 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
#!/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 python3,sphinxdoc --buildsystem=pybuild

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

execute_after_dh_install:
	find debian/python3-bumps/usr -name __pycache__ -exec rm -rf {} +

execute_after_dh_auto_build-indep:
	PYTHONPATH=`pybuild --print build_dir | awk '{print $$3}'` 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=`pybuild --print build_dir | awk '{print $$3}'` http_proxy='127.0.0.1:9' python3 -m sphinx -N -btexinfo  doc/ build/texinfo # texinfo generator

execute_after_dh_auto_build-arch:
	(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 --print build_dir | awk '{print $$3}'`; do \
	  cp bumps/dream/_compiled.so $$pybuilddir/bumps/dream; \
	done

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

execute_after_dh_auto_install-arch:
	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

execute_before_dh_installinfo-indep:
	cd build/texinfo; \
	makeinfo bumps.texi

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