File: rules

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (86 lines) | stat: -rwxr-xr-x 3,563 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
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/make -f

unexport LDFLAGS
export FFLAGS="-fPIC"
export ATLAS=None

PY2VERS:= $(shell pyversions -v -r debian/control)
PY3VERS:= $(shell py3versions -v -r debian/control)
BASE=$(shell pwd)/debian
DVER=$(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | sed 's/-[^-]*$$//')
UVER=$(shell echo $(DVER) | sed "s/+dfsg.*//g")

%:
	dh $@ --with python2,python3

override_dh_auto_clean:
	rm -rf build
	find . -name "*.pyc" -exec rm {} \;

override_dh_auto_configure:
	find scipy -name "*.pyx" | xargs cython
	cd scipy/spatial/ && python generate_qhull.py
	cd scipy/interpolate && python generate_interpnd.py
	# needed for > 0.11
	#cd scipy/special && python generate_ufuncs.py
	# umfpack.i is rebuild by setup.py
	# numpy.i and sparetools.i are included in the other sparsetools/*.i
	swig -python -c++ scipy/sparse/sparsetools/dia.i
	swig -python -c++ scipy/sparse/sparsetools/csr.i
	swig -python -c++ scipy/sparse/sparsetools/csgraph.i
	swig -python -c++ scipy/sparse/sparsetools/csc.i
	swig -python -c++ scipy/sparse/sparsetools/coo.i
	swig -python -c++ scipy/sparse/sparsetools/bsr.i
	swig -python -c++ scipy/weave/examples/swig2_ext.i

build-python%:
	python$* setup.py config_fc --noarch build;
	CFLAGS="-g -ggdb" python$*-dbg setup.py config_fc \
				--noarch build;

override_dh_auto_build: $(PY3VERS:%=build-python%) $(PY2VERS:%=build-python%)

install-python%:
	python$* setup.py install --root $(BASE)/tmp \
		--force --no-compile --install-layout=deb;

	python$*-dbg setup.py install --root $(BASE)/tmp \
		--force --no-compile --install-layout=deb;

override_dh_install: $(PY3VERS:%=install-python%) $(PY2VERS:%=install-python%)
	dh_install
	find debian/python-scipy -type f -name '*_d.so' -delete
	find debian/python3-scipy -type f -name '*.cpython-*d*.so' -delete
	find debian/python-scipy-dbg ! -type d ! -name '*_d.so' -delete
	find debian/python3-scipy-dbg ! -type d ! -name '*.cpython-*d*.so' -delete
	find debian/python-scipy-dbg -depth -empty -exec rmdir {} \;
	find debian/python3-scipy-dbg -depth -empty -exec rmdir {} \;
	rm -f $(BASE)/python-scipy*/usr/lib/python*/*-packages/scipy/LICENSE.txt;
	rm -fr $(BASE)/python-scipy*/usr/lib/python*/*-packages/scipy/weave/examples/

	# not ported to py3 in 0.10.1
	rm -rf $(BASE)/python3-scipy/usr/lib/python3/dist-packages/scipy/weave
        #call dh_numpy
	dh_numpy
	dh_numpy3

override_dh_fixperms:
	dh_fixperms
	set -e; for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
		if head -1 $$i | grep -q '^#!' ; then                      \
	    		chmod +x $$i;                                      \
		fi ;                                                       \
	done
	sed -i '1s|.|#!/usr/bin/python\n&|' $(BASE)/python-scipy/usr/lib/$(shell pyversions -d)/dist-packages/scipy/cluster/tests/vq_test.py
	sed -i '1s|.|#!/usr/bin/python\n&|' $(BASE)/python-scipy/usr/lib/$(shell pyversions -d)/dist-packages/scipy/stats/tests/test_stats.py
	sed -i '1s|.|#!/usr/bin/python3\n&|' $(BASE)/python3-scipy/usr/lib/python3/dist-packages/scipy/cluster/tests/vq_test.py
	sed -i '1s|.|#!/usr/bin/python3\n&|' $(BASE)/python3-scipy/usr/lib/python3/dist-packages/scipy/stats/tests/test_stats.py
	#replace all the usr/bin/env python
	find $(BASE)/python3-scipy/usr/lib/python3/ -name "*.py" -type f | xargs sed -i -e "1s#usr/bin/env\s\+python\s*\$$#usr/bin/env python3#"

override_dh_strip:
	dh_strip -ppython-scipy --dbg-package=python-scipy-dbg
	dh_strip -ppython3-scipy --dbg-package=python3-scipy-dbg

get-orig-source:
	-uscan --force-download --download-version $(UVER) --rename