File: rules

package info (click to toggle)
octave 4.4.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 114,832 kB
  • sloc: cpp: 310,009; ansic: 54,616; fortran: 22,631; yacc: 8,706; sh: 8,231; objc: 7,972; lex: 3,897; perl: 1,540; java: 1,309; awk: 1,070; makefile: 415; xml: 59
file content (98 lines) | stat: -rwxr-xr-x 3,879 bytes parent folder | download | duplicates (2)
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
96
97
98
#!/usr/bin/make -f
# -*- makefile -*-

# Needed by octave-common.links
include /usr/share/dpkg/pkg-info.mk
DEB_VERSION_UPSTREAM := $(subst ~rc,-rc,$(DEB_VERSION_UPSTREAM))
export DEB_VERSION_UPSTREAM

# Configure default Java paths using javahelper except on some archs.
# We require at least OpenJDK 9 (otherwise JAVA_LIBDIR below will not work)
# The following arches do not have OpenJDK 9: hppa, hurd-i386, kfreebsd-*, riscv64
# The following arches have crashes with Java
# - as of OpenJDK 9: armel
# - as of OpenJDK 10: mips, mipsel, powerpc
# This arch list must be kept in sync with the arch list qualifying
# default-jre in debian/control (note: we always want default-jdk in
# build deps because it is needed for octave-common, see
# debian/patches/always-build-octave-jar.patch).
include /usr/share/dpkg/architecture.mk
NO_JDK_ARCHS := armel hppa hurd-i386 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc riscv64
ifneq (,$(filter $(DEB_HOST_ARCH),$(NO_JDK_ARCHS)))
WITH_JAVA_FLAGS := --disable-java
else
JAVA_HOME := /usr/lib/jvm/default-java
JAVA_LIBDIR := $(shell if test -d $(JAVA_HOME)/lib/client; then echo $(JAVA_HOME)/lib/client; else echo $(JAVA_HOME)/lib/server; fi)
WITH_JAVA_FLAGS := --with-java-homedir=$(JAVA_HOME) --with-java-libdir=$(JAVA_LIBDIR)
endif

# Disable the experimental JIT unconditionally for now. The LLVM library
# interface is unstable. Linking with LLVM may also cause conflicts with other
# libraries, for example the mesa graphics stack which also uses LLVM.
JIT_FLAG := --disable-jit

# Needed to force the serial version of HDF5 even if other flavours are
# installed.
ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  HDF5_FLAGS := --with-hdf5-includedir=/usr/include/hdf5/serial \
	--with-hdf5-libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
endif

# Support the nodoc flag of DEB_BUILD_OPTIONS
ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
override_dh_auto_configure:
DOC_FLAG := --disable-docs
endif

%:
	dh $@

override_dh_auto_configure:
	# Enforce generic BLAS (in order to avoid tying the binary to OpenBLAS or ATLAS)
	# Also pass OpenMP flag (#631831)
	# Pass the install directory of fonts-freefont-otf package
	dh_auto_configure -- \
		--with-blas=blas --enable-openmp \
		--with-system-freefont=/usr/share/fonts/opentype/freefont \
		$(WITH_JAVA_FLAGS) $(JIT_FLAG) $(HDF5_FLAGS) $(DOC_FLAG)

# dh_auto_test tries to run "make test", so override it
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	make check
	# Run builtin-features to ensure important features are included
	env OCTAVE=./run-octave debian/tests/builtin-features
endif

# override normal dh_compress call to avoid compressing .pdf files
override_dh_compress:
	dh_compress --exclude=.pdf

override_dh_auto_install:
	dh_auto_install
	# Delete .la files (for liboctgui)
	find debian/tmp -name '*.la' -delete

# The info files have references to .png images, so also ship those.
# Note that we do not install all doc/interpreter/*.png, since some are not referenced
# when compiling the output info (using @ifnotinfo macro).
# We used to rename them by prefixing their name with "octave-", but this was breaking some
# info files (see #816534).
override_dh_installinfo-indep:
	dh_installinfo
	for f in `grep -a src=\".*\" doc/interpreter/*.info* | sed 's/.*src="\([^"]*\)".*/\1/'`; do \
		cp doc/interpreter/$$f debian/octave-doc/usr/share/info/; \
	done

# Strip the executable bit from the .oct files
# Cannot be done in dh_fixperms, as then dh_strip and dh_shlibdeps don't take the
# .oct files into account
override_dh_shlibdeps:
	dh_shlibdeps
	find debian/octave -name '*.oct' -print0 2>/dev/null | xargs -0r chmod 644

# Avoid useless call of ldconfig in the triggers script of the octave
# package
override_dh_makeshlibs:
	dh_makeshlibs --package=octave --noscripts
	dh_makeshlibs --no-package=octave