File: rules

package info (click to toggle)
mrtrix3 3.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 13,712 kB
  • sloc: cpp: 129,776; python: 9,494; sh: 593; makefile: 234; xml: 47
file content (87 lines) | stat: -rwxr-xr-x 2,668 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
#!/usr/bin/make -f
# -*- makefile -*-

# get octave paths (have to build-depend on octave-headers)
include /usr/share/octave/debian/defs.make
# same for Matlab
include /usr/share/matlab/debian/defs.make

# on older systems such as 16.04 PIE is not enabled by  default and
# configure them fails # to link
DISABLE_HARDENING_OPTS=$(shell  g++ -v 2>&1 | grep -q -e --enable-default-pie || echo ",-pie")
export DEB_BUILD_MAINT_OPTIONS=hardening=+all$(DISABLE_HARDENING_OPTS)

# To avoid --match=native since wouldn't be supported on some platforms
export CPP_MARCH=
# upstream have their own interpretation of build flags
export CFLAGS+=$(CPPFLAGS) $(CXXFLAGS)
export LINKFLAGS=$(LDFLAGS)

include /usr/share/dpkg/architecture.mk
# guarantee the same precision on x86 platforms for tests
ifneq (,$(findstring z$(DEB_HOST_ARCH)z,zamd64z zi386z))
    CFLAGS+=-mmmx -msse -msse2 -mfpmath=sse
endif

# To prevent any online interactions
export  http_proxy=http://127.0.0.1:9/
export  https_proxy=http://127.0.0.1:9/

export QT_SELECT=qt5

%:
	dh $@

override_dh_auto_configure:
	./configure -openmp # -debug

override_dh_auto_build:
	./build -verbose

override_dh_install:
	dh_install
	# Remove __pycache__ dirs that were created in build time tests
	find debian -name __pycache__ -type d | xargs rm -rf

override_dh_auto_test:
# Disabled for now since require test data which is linked
# via git submodules in original upstream github
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	./run_tests || { cat testing.log; exit 1; }
#endif

override_dh_link:
	cp debian/mrtrix3.links.in debian/mrtrix3.links
	: # Generate symlinks for all the mr* commands
	for f in debian/mrtrix3/usr/lib/mrtrix3/bin/*; do \
		bn=$$(basename $$f); \
		if [ "$$bn" = "dirsplit" ]; then \
			continue; \
		fi; \
		echo "usr/lib/mrtrix3/bin/$$bn usr/bin/$$bn" >> debian/mrtrix3.links; \
	    echo "/usr/share/man/man1/mrtrix3.1.gz /usr/share/man/man1/$$bn.1.gz" >> debian/mrtrix3.links; \
	done
	echo "/usr/share/mrtrix3/matlab $(MATLAB_MDIR)/mrtrix" >> debian/mrtrix3.links
	echo "/usr/share/mrtrix3/matlab $(MDIR)/mrtrix" >> debian/mrtrix3.links
	dh_link

# we want immediately useable docs and example data, they are in a dedicated
# package already
override_dh_compress:
	dh_compress -X.html

override_dh_clean:
	[ -f config ] && python3 ./build clean || true
	find . -name '*.pyc' -delete
	-rm clean \
		config configure.log build.log \
		core/version.cpp lib/mrtrix3/_version.py src/exec_version.cpp \
		icons/mrview.qrc icons/shview.qrc
	dh_clean
	@rm -f debian/mrtrix.links

override_dh_shlibdeps:
	dh_shlibdeps -l $(CURDIR)/lib

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3