#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk PY3VERS := $(shell py3versions -s) LIB := $$(python3 -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print(b.build_platlib)") # This should have the same result without using distutils and thus beeing save with Python3.12 - but it fails creating the docs # LIB := $$(find build -type d -name mpl_toolkits | grep `py3versions -d -v | sed 's/\.//'` | sed 's?/mpl_toolkits??') %: dh $@ --with sphinxdoc,python3 --buildsystem=pybuild override_dh_auto_install: set -e ; \ for python in $(PY3VERS); do \ $$python setup.py install --root $(CURDIR)/debian/python3-mpltoolkits.basemap/ --install-layout=deb; \ done override_dh_auto_build: set -e ; \ cython3 -3 src/*pyx; \ for python in $(PY3VERS); do \ $$python setup.py build; \ done # HACK: we need to import axes_grid1 but we need to import it from the "local" # mpl_toolkits namespace ln -s $$(dirname $$(python3 -c "import mpl_toolkits.axes_grid1 as p; print(p.__file__)")) $(CURDIR)/$(LIB)/mpl_toolkits/ # build doc only for default python version mv $(CURDIR)/$(LIB)/*.so $(CURDIR)/$(LIB)/mpl_toolkits (export MPLCONFIGDIR=. ; cd doc ; PYTHONPATH=$(CURDIR)/$(LIB)/mpl_toolkits BASEMAPDATA=$(CURDIR)/lib/mpl_toolkits/basemap/data/ python3 make.py html) # remove hack rm $(CURDIR)/$(LIB)/mpl_toolkits/axes_grid1 mv $(CURDIR)/$(LIB)/mpl_toolkits/*.so $(CURDIR)/$(LIB) override_dh_python3: dh_python3 -chmod -x debian/python-mpltoolkits.basemap-data/usr/share/basemap/data/* dh_numpy3 override_dh_sphinxdoc: dh_sphinxdoc -i override_dh_clean: dh_clean rm -rf doc/build rm -f nad2bin.o nad2bin