File: rules

package info (click to toggle)
simgrid 3.21%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 21,972 kB
  • sloc: cpp: 88,193; ansic: 69,244; fortran: 6,089; f90: 5,162; xml: 4,861; java: 4,250; perl: 2,056; python: 1,193; sh: 1,159; makefile: 57; sed: 6
file content (93 lines) | stat: -rwxr-xr-x 3,705 bytes parent folder | download
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
#!/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

ifeq ($(DEB_HOST_GNU_CPU),arm)
  CFLAGS += -funwind-tables
endif

LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)

%:
	dh $@ --with python3 --parallel

# 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_smpi_MPICH3_testsuite=ON \
		-Denable_java=ON -Denable_lib_in_jar=OFF \
		${CMAKE_FLAGS}

override_dh_auto_build:
	dh_auto_build -- all documentation

# 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
	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
	# 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
	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
	# Use the right path to interpreter
	sed -e 's|#!/usr/bin/env perl|#! /usr/bin/perl|' -i debian/tmp/usr/bin/*
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	# Use system-wide javascript libraries, both in javadoc packages and doxygen ones
	find debian -name jquery-ui.js                 -exec ln -sfv /usr/share/javascript/jquery-ui/jquery-ui.js {} \;
	find debian -name jquery-ui.min.js             -exec ln -sfv /usr/share/javascript/jquery-ui/jquery-ui.min.js {} \;
	find debian -name jquery-ui.structure.min.css  -exec ln -sfv /usr/share/javascript/jquery-ui/themes/base/jquery-ui.css {} \;
	find debian -name jquery-ui.structure.css      -exec ln -sfv /usr/share/javascript/jquery-ui/themes/base/jquery-ui.css {} \;
	find debian -name jquery-ui.min.css            -exec ln -sfv /usr/share/javascript/jquery-ui/css/smoothness/jquery-ui.min.css {} \;
	find debian -name jquery.js                    -exec ln -sfv /usr/share/javascript/jquery/jquery.js {} \;
	find debian -name jquery-1.10.2.js             -exec ln -sfv /usr/share/javascript/jquery/jquery.js {} \;
	find debian -name jquery-ui.css                -exec ln -sfv /usr/share/javascript/jquery-ui/themes/base/jquery-ui.css {} \;
endif

# 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.