#!/usr/bin/make -f # -*- makefile -*- # Package building rules for the SimGrid Debian Package. # Strongly inspirated from the sample debhelper file, originally written by Joey Hess and Craig Small. # Adapted to SimGrid by Lucas Nussbaum and Martin Quinson. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # See 'man dpkg-architecture' include /usr/share/dpkg/architecture.mk CMAKE_FLAGS= ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 CMAKE_FLAGS += -Denable_compile_optimizations=off else CFLAGS += $(shell dpkg-buildflags --get CFLAGS) # build with -O3 everywhere since it is upstream policy to do so. CFLAGS += -O3 endif ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) CMAKE_FLAGS += -Denable_documentation=off endif export DEB_BUILD_MAINT_OPTIONS += hardening=+all LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS) %: dh $@ --with python3 --buildsystem=cmake # CMAKE_BUILD_TYPE= (unset CMAKE_BUILD_TYPE) required, because: # - dh magic runs cmake with -DCMAKE_BUILD_TYPE=RelWithDebInfo # - this adds -DNDEBUG to CFLAGS (maybe a bug, see #711515) # - this breaks simgrid (or at least some tests). override_dh_auto_configure: CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ dh_auto_configure -Scmake -- \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE= \ -Denable_msg=ON -Denable_java=ON \ -Denable_smpi_MPICH3_testsuite=ON \ -Denable_lib_in_jar=OFF \ ${CMAKE_FLAGS} override_dh_auto_build: dh_auto_build -- all tests # FIXME renable tests at some point override_dh_auto_test: dh_auto_test || true # Make install and prepare package building override_dh_auto_install: dh_auto_install # Manually install the python module, since upstream fails to do so mkdir -p debian/tmp/usr/lib/python3/dist-packages cp obj-*/lib/simgrid.cpython*.so debian/tmp/usr/lib/python3/dist-packages chrpath -d debian/tmp/usr/lib/python3/dist-packages/simgrid.cpython*.so # Fix chrpath of binaries chrpath -d debian/tmp/usr/bin/graphicator chrpath -d debian/tmp/usr/lib/simgrid/smpimain mv debian/tmp/usr/bin/graphicator debian/tmp/usr/bin/simgrid-graphicator # Remove the so link of the JNI library, as is does not fit in # libsimgrid-dev without inducing a dependency from simgrid-dev to the # whole java world, and this library is of no use in the # native world, only useful in Java (that does not need the so link) rm debian/tmp/usr/lib/libsimgrid-java.so # move doc to correct place # mkdir -p debian/tmp/usr/share/doc/simgrid # mv debian/tmp/usr/doc/simgrid/* debian/tmp/usr/share/doc/simgrid/ # mv debian/tmp/usr/share/doc/simgrid/html/javadoc debian/tmp/usr/share/doc/simgrid/ # rmdir debian/tmp/usr/doc/simgrid # move jarfile to the right location (if it was compiled) if [ -e debian/tmp/usr/java/simgrid.jar ] ; then \ mkdir -p debian/tmp/usr/share/java; \ mv debian/tmp/usr/java/simgrid.jar debian/tmp/usr/share/java; \ rm -rf debian/tmp/usr/java; \ fi # Use the right path to interpreter sed -e 's|#! */usr/bin/env perl|#! /usr/bin/perl|' -i debian/tmp/usr/bin/* # Ensure that no file where left over when building the package override_dh_install: dh_install dh_missing --fail-missing # get-orig-source: this target is now deprecated. Simply type 'uscan' to get the same effect.