File: rules

package info (click to toggle)
basemap 1.2.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 212,272 kB
  • sloc: python: 9,541; ansic: 266; makefile: 39; sh: 23
file content (54 lines) | stat: -rwxr-xr-x 1,884 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
#!/usr/bin/make -f

PY2VERS := $(shell pyversions -s)
PY3VERS := $(shell py3versions -s)
LIB := $$(python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib")

%:
	dh $@ --with sphinxdoc,python2,python3

override_dh_auto_install:
	set -e ; \
	cython3 -2 src/*pyx; \
	for python in $(PY2VERS); do \
		$$python setup.py install --root $(CURDIR)/debian/python-mpltoolkits.basemap/ --install-layout=deb; \
		$$python-dbg setup.py install --root $(CURDIR)/debian/python-mpltoolkits.basemap-dbg/ --install-layout=deb; \
	done
	set -e ; \
	cython3 -3 src/*pyx; \
	for python in $(PY3VERS); do \
		$$python setup.py install --root $(CURDIR)/debian/python3-mpltoolkits.basemap/ --install-layout=deb; \
		$$python-dbg setup.py install --root $(CURDIR)/debian/python3-mpltoolkits.basemap-dbg/ --install-layout=deb; \
	done
	dh_numpy

build: build-arch build-indep ;

build-arch:
	dh build

build-indep: build-arch
	# HACK: we need to import axes_grid1 but we need to import it from the "local"
	# mpl_toolkits namespace
	ln -s $$(dirname $$(python -c "import mpl_toolkits.axes_grid1 as p; print p.__file__")) $(CURDIR)/$(LIB)/mpl_toolkits/
	# build doc only for default python version
	(export MPLCONFIGDIR=. ; cd doc ; PYTHONPATH=$(CURDIR)/$(LIB) BASEMAPDATA=$(CURDIR)/lib/mpl_toolkits/basemap/data/ python make.py html)
	# remove hack
	rm $(CURDIR)/$(LIB)/mpl_toolkits/axes_grid1

override_dh_sphinxdoc:
	dh_sphinxdoc -i

override_dh_clean:
	dh_clean
	rm -rf doc/build
	rm -f nad2bin.o nad2bin

override_dh_builddeb:
	dh_builddeb -- -Zxz

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -ppython-mpltoolkits.basemap --dbg-package=python-mpltoolkits.basemap-dbg
	dh_strip -ppython3-mpltoolkits.basemap --dbg-package=python3-mpltoolkits.basemap-dbg
endif