From 743775baaa9b9374834a7aa886087d0e156c30b7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 23 Feb 2019 11:27:35 +0000 Subject: [PATCH] strip --- debian/rules | 86 ++++---------------------------------------- debian/rules.removed | 73 +++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 79 deletions(-) create mode 100644 debian/rules.removed diff --git a/debian/rules b/debian/rules index 0438fc6..c9e1554 100755 --- a/debian/rules +++ b/debian/rules @@ -1,88 +1,16 @@ #!/usr/bin/make -f -BUILDDIR = $(CURDIR)/debian/build +#BUILDDIR = $(CURDIR)/debian/build -PYVERS := $(shell pyversions -vr debian/control) +#PYVERS := $(shell pyversions -vr debian/control) # The directories below are versioned. We only support the packages for the # stable version of Octave -mpath = $(shell octave-config -p LOCALFCNFILEDIR)/nlopt -bpath = $(shell octave-config -p LOCALOCTFILEDIR)/nlopt +#mpath = $(shell octave-config -p LOCALFCNFILEDIR)/nlopt +#bpath = $(shell octave-config -p LOCALOCTFILEDIR)/nlopt -export DEB_BUILD_MAINT_OPTIONS=hardening=+all +#export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: - dh $@ --buildsystem=autoconf --builddirectory=$(BUILDDIR) --with python2 - -override_dh_auto_configure: - for v in $(PYVERS); do \ - dh_auto_configure --builddirectory=$(BUILDDIR)$$v \ - -- $(extra_flags) \ - --prefix=/usr \ - --srcdir=$(CURDIR) \ - --enable-shared \ - PYTHON=/usr/bin/python$$v \ - OCT_INSTALL_DIR=$(bpath) M_INSTALL_DIR=$(mpath) \ - GUILE=guile GUILE_CONFIG=guile-config; \ - done - -override_dh_auto_build: - for v in $(PYVERS); do \ - dh_auto_build --builddirectory=$(BUILDDIR)$$v; \ - done - # Now configure and build again for C++ - dh_auto_configure --builddirectory=$(BUILDDIR)$$v \ - -- $(extra_flags) \ - --prefix=/usr \ - --srcdir=$(CURDIR) \ - --enable-shared \ - --with-cxx - dh_auto_build --builddirectory=$(BUILDDIR)$$v; \ - -override_dh_clean: - dh_clean --exclude='*.orig' - -override_dh_auto_clean: - for v in $(PYVERS); do \ - rm -rf $(BUILDDIR)$$v; \ - done - -override_dh_strip: - dh_strip - find debian/octave-nlopt/usr/lib -name *.oct | \ - xargs strip --strip-unneeded --remove-section=.comment - -override_dh_makeshlibs: - dh_makeshlibs $(shell for v in $(PYVERS); do printf -- "-X/usr/lib/python$$v/dist-packages "; done) - -override_dh_shlibdeps: - dh_shlibdeps - dh_octave_substvar - -override_dh_auto_install: - for v in $(PYVERS); do \ - dh_auto_install --builddirectory=$(BUILDDIR)$$v; \ - done - - dh_numpy - find debian/tmp/usr/lib/python* \ - -name '*.pyc' -o -name '*.pyo' \ - -o -name '*.la' -o -name '*.a' | xargs rm - -override_dh_install: - dh_install - # Remove C++ header from C interface - find debian/libnlopt-dev -name nlopt.hpp -delete - -override_dh_link: - for package in libnlopt-dev libnlopt-guile0 octave-nlopt python-nlopt; do \ - rm -rf debian/$$package/usr/share/doc/$$package; \ - done - dh_link - - -override_dh_auto_test: - for v in $(PYVERS); do \ - dh_auto_test --builddirectory=$(BUILDDIR)$$v \ - -- $(extra_flags); \ - done + dh $@ --buildsystem=cmake +# --builddirectory=$(BUILDDIR) --with python2 diff --git a/debian/rules.removed b/debian/rules.removed new file mode 100644 index 0000000..49b29e6 --- /dev/null +++ b/debian/rules.removed @@ -0,0 +1,73 @@ + +override_dh_auto_configure: + for v in $(PYVERS); do \ + dh_auto_configure --builddirectory=$(BUILDDIR)$$v \ + -- $(extra_flags) \ + --prefix=/usr \ + --srcdir=$(CURDIR) \ + --enable-shared \ + PYTHON=/usr/bin/python$$v \ + OCT_INSTALL_DIR=$(bpath) M_INSTALL_DIR=$(mpath) \ + GUILE=guile GUILE_CONFIG=guile-config; \ + done + +override_dh_auto_build: + for v in $(PYVERS); do \ + dh_auto_build --builddirectory=$(BUILDDIR)$$v; \ + done + # Now configure and build again for C++ + dh_auto_configure --builddirectory=$(BUILDDIR)$$v \ + -- $(extra_flags) \ + --prefix=/usr \ + --srcdir=$(CURDIR) \ + --enable-shared \ + --with-cxx + dh_auto_build --builddirectory=$(BUILDDIR)$$v; \ + +override_dh_clean: + dh_clean --exclude='*.orig' + +override_dh_auto_clean: + for v in $(PYVERS); do \ + rm -rf $(BUILDDIR)$$v; \ + done + +override_dh_strip: + dh_strip + find debian/octave-nlopt/usr/lib -name *.oct | \ + xargs strip --strip-unneeded --remove-section=.comment + +override_dh_makeshlibs: + dh_makeshlibs $(shell for v in $(PYVERS); do printf -- "-X/usr/lib/python$$v/dist-packages "; done) + +override_dh_shlibdeps: + dh_shlibdeps + dh_octave_substvar + +override_dh_auto_install: + for v in $(PYVERS); do \ + dh_auto_install --builddirectory=$(BUILDDIR)$$v; \ + done + + dh_numpy + find debian/tmp/usr/lib/python* \ + -name '*.pyc' -o -name '*.pyo' \ + -o -name '*.la' -o -name '*.a' | xargs rm + +override_dh_install: + dh_install + # Remove C++ header from C interface + find debian/libnlopt-dev -name nlopt.hpp -delete + +override_dh_link: + for package in libnlopt-dev libnlopt-guile0 octave-nlopt python-nlopt; do \ + rm -rf debian/$$package/usr/share/doc/$$package; \ + done + dh_link + + +override_dh_auto_test: + for v in $(PYVERS); do \ + dh_auto_test --builddirectory=$(BUILDDIR)$$v \ + -- $(extra_flags); \ + done -- 2.30.2