#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk CFLAGS+=$(CPPFLAGS) CXXFLAGS+=$(CPPFLAGS) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) test_makeflags = -j$(NUMJOBS) endif %: dh $@ --buildsystem=cmake --with python3 override_dh_clean: rm -rf builddir rm -rf python/test/persalys dh_clean override_dh_auto_configure: dh_auto_configure -Bbuilddir -- \ -DUSE_SPHINX=OFF \ -DUSE_SALOME=OFF \ -DCMAKE_CXX_FLAGS:STRING="$(CXXFLAGS)" \ -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(LDFLAGS)" \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DINSTALL_DESTDIR:PATH=$(CURDIR)/debian/persalys \ -DLINK_PYTHON_LIBRARY:BOOL=OFF \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 override_dh_auto_build: $(MAKE) $(test_makeflags) -C builddir override_dh_auto_install: dh_auto_install -Bbuilddir ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) # Building the folder of the persalys Python module in the Python test # directory so that it is found during the tests. if [ ! -e python/test/persalys ]; then \ mkdir python/test/persalys ; \ cp python/src/__init__.py python/test/persalys ; \ cp builddir/python/src/persalys.py python/test/persalys ; \ cp builddir/python/src/_persalys*.so python/test/persalys ; \ fi # Looking for the shared lib that is about to be installed. LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$${LD_LIBRARY_PATH}:}$(CURDIR)/debian/libpersalys0/usr/lib/$(DEB_HOST_MULTIARCH) \ CTEST_OUTPUT_ON_FAILURE=1 \ xvfb-run -s "-screen 0 1024x768x24" $(MAKE) $(test_makeflags) -C builddir test ARGS="$(test_makeflags) -R pyinstallcheck" find $(CURDIR)/debian/persalys -name "*.pyc" -o -name "__pycache__" | xargs rm -rf endif override_dh_makeshlibs: dh_makeshlibs -Xpyshared override_dh_compress: dh_compress -X.pdf -X.svn -X.py override_dh_auto_test: # Building the folder of the persalys Python module in the C++ test directory # so that it is found during the tests. ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) if [ ! -e builddir/lib/test/persalys ]; then \ mkdir builddir/lib/test/persalys ; \ cp python/src/__init__.py builddir/lib/test/persalys ; \ cp builddir/python/src/persalys.py builddir/lib/test/persalys ; \ cp builddir/python/src/_persalys*.so builddir/lib/test/persalys ; \ fi # 'make test' does not build binary tests $(MAKE) $(test_makeflags) -C builddir tests CTEST_OUTPUT_ON_FAILURE=1 \ xvfb-run -s "-screen 0 1024x768x24" $(MAKE) -C builddir test ARGS="$(test_makeflags) -R cppcheck" endif