1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#!/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_documentation=ON \
-Denable_msg=ON -Denable_java=ON \
-Denable_smpi_MPICH3_testsuite=ON \
-Denable_lib_in_jar=OFF \
-Denable_ns3=ON \
${CMAKE_FLAGS}
override_dh_auto_build:
dh_auto_build -- all tests manpages
# 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
# Rename the graphicator to avoid name clashes in Debian
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.
|