File: rules

package info (click to toggle)
cmtk 3.3.1p1+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 10,492 kB
  • sloc: cpp: 87,098; ansic: 23,347; sh: 3,896; xml: 1,551; perl: 707; makefile: 332
file content (90 lines) | stat: -rwxr-xr-x 2,485 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
#!/usr/bin/make -f
# -*- makefile -*-

DISTDIR=$(CURDIR)/debian/cmtk

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

export  http_proxy=http://127.0.0.1:9/
export  https_proxy=http://127.0.0.1:9/

# custom option tests to provide build for validating unittests
ifneq (,$(findstring docheck,$(DEB_BUILD_OPTIONS)))
	TESTING=ON
	DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 ifeq ($(DEB_HOST_ARCH),i386)
	TFLAGS=-march=pentium4
    TFLAGS+=-mmmx -msse -msse2 -mfpmath=sse
 endif
 ifeq ($(DEB_HOST_ARCH),amd64)
	TFLAGS=-march=nocona
    TFLAGS+=-mmmx -msse -msse2 -mfpmath=sse
 endif
	OPT_CMAKE_FLAGS=-DCMAKE_C_FLAGS:STRING="$(TFLAGS)" \
					-DCMAKE_ANSI_CXXFLAGS:STRING="$(TFLAGS)" \
                    -DCMTK_DATA_ROOT:PATH=/home/yoh/deb/gits/pkg-exppsy/cmtk.gitsvn/data
else
	TESTING=OFF
	export DEB_BUILD_OPTIONS += " nocheck"
endif

%:
	dh $@


override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
		-DBUILD_APPS:BOOL=ON \
		-DBUILD_DOCUMENTATION:BOOL=OFF \
		-DBUILD_GUI:BOOL=OFF \
		-DBUILD_SHARED_LIBS:BOOL=ON \
		-DBUILD_TESTING:BOOL=$(TESTING) \
		-DCMTK_BUILD_DCMTK:BOOL=OFF \
		-DCMTK_BUILD_MXML:BOOL=OFF \
		-DCMTK_BUILD_NRRD:BOOL=ON \
		-DCMTK_BUILD_SQLITE:BOOL=OFF \
		-DCMTK_BUILD_ZLIB:BOOL=OFF \
		-DCMTK_ROOT_PATH_SRI24:PATH=/usr/share/data/sri24-atlas \
		-DCMTK_USE_DCMTK:BOOL=ON \
		-DCMTK_USE_FFTW:BOOL=ON \
		-DCMTK_USE_QT:BOOL=OFF \
		-DCMTK_USE_SMP:BOOL=ON \
		-DCMTK_USE_SQLITE:BOOL=ON \
		-DDART_TESTING_TIMEOUT:STRING=15000 \
		-DMXML_INCLUDE_DIR:PATH=/usr/include \
		-DLZMA_INCLUDE_DIRS:PATH=/usr/include/lzma \
		-DCMAKE_SKIP_RPATH:BOOL=OFF \
		-DCMTK_BUILD_WRAPPER:BOOL=ON \
		$(OPT_CMAKE_FLAGS)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	ARGS=--verbose xvfb-run --auto-servernum --server-num=20 \
		dh_auto_test
endif

override_dh_auto_install:
	dh_auto_install

	: # Remove not needed headers, cmake files etc
	rm -fr $(DISTDIR)/usr/include
	-/usr/bin/find $(DISTDIR) -iname *.cmake -delete

	: # Prune duplicate docs
	rm -fr $(DISTDIR)/usr/share/cmtk/doc

	: # Generate manpages
	xvfb-run --auto-servernum --server-num=20 \
		scripts/gen_manpages \
	|| dpkg -l xvfb | awk '/xvfb/{print $3;}' | grep -q ubuntu
	: # Above condition just to ignore unclean exit from xvfb on elderly broken ubuntus
	: # Cleaner solution patches are welcome!

override_dh_installman:
	dh_installman debian/manpages/*

override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/manpages