#!/usr/bin/make -f #export DH_VERBOSE=1 include /usr/share/dpkg/pkg-info.mk export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS = hardening=+all DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) CHANGELOG_DATE ?= $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH) +"%d %B %Y") DEBIAN_VERSION_SUFFIX = $(shell echo $(DEB_VERSION) | sed 's,.*\+\([0-9][0-9]*\).*,\1,') OCTAVE_BPATH = usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/octave/packages OCTAVE_HOSTTYPE = $(shell octave-config -p CANONICAL_HOST_TYPE) OCTAVE_API_VERSION = $(shell octave-config -p API_VERSION) OCTAVE_FULLBPATH = $(OCTAVE_BPATH)/openems-0.0.35/$(OCTAVE_HOSTTYPE)-$(OCTAVE_API_VERSION) PYTHON3VERSIONS := $(shell py3versions -s -v) export CXXFLAGS := $(CXXFLAGS) -DSSE_CORRECT_DENORMALS=0 %: dh $@ --with python3 # Since some sub-folders depend on other sub-folders to be installed before # they can be configured, dh_auto_configure and dh_auto_build cannot be use for # configuration and build: override_dh_auto_configure: override_dh_auto_build: override_dh_auto_install: cd CSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. && make && make install DESTDIR=../../debian/tmp cd QCSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. && make && make install DESTDIR=../../debian/tmp cd openEMS && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. cd openEMS/build && make cd openEMS/build && make install DESTDIR=../../debian/tmp cd AppCSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DQCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. cd AppCSXCAD/build && make cd AppCSXCAD/build && make install DESTDIR=../../debian/tmp cd debian/tmp/usr/share/openEMS/matlab && CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" mkoctfile -L/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial -lhdf5_cpp -DH5_USE_16_API -I/usr/include/hdf5/serial h5readatt_octave.cc mkdir -p debian/tmp/$(OCTAVE_FULLBPATH) mv debian/tmp/usr/share/openEMS/matlab/h5readatt_octave.oct debian/tmp/$(OCTAVE_FULLBPATH)/ rm debian/tmp/usr/share/openEMS/matlab/h5readatt_octave.cc chrpath -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so* chrpath -d debian/tmp/usr/bin/AppCSXCAD chrpath -d debian/tmp/usr/bin/nf2ff chrpath -d debian/tmp/usr/bin/openEMS cd CSXCAD/python && CPPFLAGS=-I../../debian/tmp/usr/include LDFLAGS=-L../../debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --build && PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --install cd openEMS/python && CPPFLAGS=-I../../debian/tmp/usr/include LDFLAGS=-L../../debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --build && PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --install override_dh_auto_clean: dh_auto_clean $(RM) -r CSXCAD/build || true $(RM) -r QCSXCAD/build || true $(RM) -r openEMS/build || true $(RM) -r AppCSXCAD/build || true $(RM) debian/man/*.1 cd CSXCAD/python && PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --clean cd openEMS/python && PYBUILD_VERSIONS="$(PYTHON3VERSIONS)" pybuild --clean $(RM) -r CSXCAD/python/debian $(RM) -r openEMS/python/debian $(RM) CSXCAD/python/CSXCAD/*.cpp $(RM) openEMS/python/openEMS/*.cpp $(RM) -r CSXCAD/python/.pybuild/ $(RM) -r openEMS/python/.pybuild/ override_dh_installman: cd debian/man ; CHANGELOG_DATE="$(CHANGELOG_DATE)" ./genmanpages.sh dh_installman