3 BUILDDIR = $(CURDIR)/debian/build
5 PYVERS := $(shell pyversions -vr debian/control)
7 # The directories below are versioned. We only support the packages for the
8 # stable version of Octave
9 mpath = $(shell octave-config -p LOCALFCNFILEDIR)/nlopt
10 bpath = $(shell octave-config -p LOCALOCTFILEDIR)/nlopt
12 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
15 dh $@ --buildsystem=autoconf --builddirectory=$(BUILDDIR) --with python2
17 override_dh_auto_configure:
18 for v in $(PYVERS); do \
19 dh_auto_configure --builddirectory=$(BUILDDIR)$$v \
24 PYTHON=/usr/bin/python$$v \
25 OCT_INSTALL_DIR=$(bpath) M_INSTALL_DIR=$(mpath) \
26 GUILE=guile GUILE_CONFIG=guile-config; \
29 override_dh_auto_build:
30 for v in $(PYVERS); do \
31 dh_auto_build --builddirectory=$(BUILDDIR)$$v; \
33 # Now configure and build again for C++
34 dh_auto_configure --builddirectory=$(BUILDDIR)$$v \
40 dh_auto_build --builddirectory=$(BUILDDIR)$$v; \
43 dh_clean --exclude='*.orig'
45 override_dh_auto_clean:
46 for v in $(PYVERS); do \
47 rm -rf $(BUILDDIR)$$v; \
52 find debian/octave-nlopt/usr/lib -name *.oct | \
53 xargs strip --strip-unneeded --remove-section=.comment
55 override_dh_makeshlibs:
56 dh_makeshlibs $(shell for v in $(PYVERS); do printf -- "-X/usr/lib/python$$v/dist-packages "; done)
58 override_dh_shlibdeps:
62 override_dh_auto_install:
63 for v in $(PYVERS); do \
64 dh_auto_install --builddirectory=$(BUILDDIR)$$v; \
68 find debian/tmp/usr/lib/python* \
69 -name '*.pyc' -o -name '*.pyo' \
70 -o -name '*.la' -o -name '*.a' | xargs rm
74 # Remove C++ header from C interface
75 find debian/libnlopt-dev -name nlopt.hpp -delete
78 for package in libnlopt-dev libnlopt-guile0 octave-nlopt python-nlopt; do \
79 rm -rf debian/$$package/usr/share/doc/$$package; \
84 override_dh_auto_test:
85 for v in $(PYVERS); do \
86 dh_auto_test --builddirectory=$(BUILDDIR)$$v \