File: rules

package info (click to toggle)
gdcm 2.6.6-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 29,952 kB
  • ctags: 49,807
  • sloc: cpp: 193,527; ansic: 119,435; xml: 44,906; sh: 7,153; python: 3,670; cs: 2,202; java: 1,344; lex: 1,290; tcl: 677; php: 128; makefile: 119
file content (157 lines) | stat: -rwxr-xr-x 5,346 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/usr/bin/make -f
# export DH_VERBOSE=1


# results in linking error 
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# to please dpkg-shlibdeps and java private libs in /usr/lib/jni
LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):/usr/lib/jni

# required for DEB_MONO_ARCHS (debian/control.in)
-include /usr/share/mono/mono-archs.make

# Mono is not available for all Debian architectures.
ifeq ($(shell dh_listpackages | grep -q cil && echo yes),yes)
WITH_CLI = --with cli
DEB_WRAP_CSHARP = 1
# dpkg-shlibdeps needs to know where is libKitware.mummy.Runtime.Unmanaged.so
LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):/usr/lib/cli/Kitware.mummy.Runtime-1.0
else
WITH_CLI =
DEB_WRAP_CSHARP = 0
endif
export LD_LIBRARY_PATH

DEFAULT_JAVA_VERSION=1.7
ifeq ($(DEB_BUILD_ARCH),hurd-i386)
  DEFAULT_JAVA_VERSION=1.5
endif 

# deduce documentation option (build-indep target)
ifeq "" "$(filter %-doc,$(shell dh_listpackages))"
  BUILDDOC = OFF
else
  BUILDDOC = ON
endif

%:
	dh $@ $(WITH_CLI) --with python2 --parallel --with javahelper 

PYVER 	 := $(shell pyversions -dv)
PYMODDIR := /usr/lib/$(shell pyversions -r)
VTKVERS=$(shell apt-cache policy libvtk6-dev | grep "Installed:" | cut -d: -f2 | cut -d' ' -f2 | cut -d- -f1 | cut -d. -f1-2)

# GDCM_DOCUMENTATION:BOOL=ON is required to build man page (build target)
# Need to make sure to build using the same vtk/python version:
CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_RPATH=ON \
		-DCMAKE_BUILD_TYPE:STRING=None \
		-DGDCM_DOXYGEN_NO_FOOTER:BOOL=ON \
		-DGDCM_BUILD_APPLICATIONS:BOOL=ON \
		-DGDCM_DOCUMENTATION:BOOL=$(BUILDDOC) \
		-DGDCM_VTK_DOCUMENTATION:BOOL=$(BUILDDOC) \
		-DDOCUMENTATION_DOWNLOAD_VTK_TAGFILE:BOOL=OFF \
		-DGDCM_PDF_DOCUMENTATION:BOOL=$(BUILDDOC) \
		-DGDCM_BUILD_SHARED_LIBS:BOOL=ON \
		-DGDCM_WRAP_PYTHON:BOOL=ON \
		-DGDCM_WRAP_CSHARP:BOOL=$(DEB_WRAP_CSHARP) \
		-DGDCM_WRAP_JAVA:BOOL=ON \
		-DGDCM_DEFAULT_JAVA_VERSION:STRING=$(DEFAULT_JAVA_VERSION) \
		-DGDCM_WRAP_PHP:BOOL=OFF \
		-DGDCM_USE_PVRG:BOOL=ON \
		-DGDCM_USE_SYSTEM_PVRG:BOOL=ON \
		-DGMCS_EXECUTABLE:FILEPATH=/usr/bin/mono-csc \
		-DGDCM_BUILD_TESTING:BOOL=OFF \
		-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON \
		-DGDCM_USE_SYSTEM_UUID:BOOL=ON \
		-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON \
		-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON \
		-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON \
		-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON \
		-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON \
		-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON \
		-DGDCM_USE_SYSTEM_JSON:BOOL=ON \
		-DGDCM_USE_PARAVIEW:BOOL=OFF \
		-DGDCM_USE_ACTIVIZ:BOOL=OFF \
		-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=ON \
		-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=ON \
		-DPython_ADDITIONAL_VERSIONS:STRING=$(PYVER) \
		-DGDCM_INSTALL_DOC_DIR:STRING=share/doc/gdcm-doc \
		-DTAGFILES:STRING="/usr/share/doc/vtk-doc/html/vtk$(VTKVERS).tag=/usr/share/doc/vtk-doc/html/" \
		-DGDCM_INSTALL_PYTHONMODULE_DIR:STRING=lib/python/dist-packages \
		-DGDCM_INSTALL_JAVAMODULE_DIR:STRING=lib/$(DEB_HOST_MULTIARCH)/jni \
		-DGDCM_NO_PYTHON_LIBS_LINKING:BOOL=ON \
                -DGDCM_NO_VTKJAVA_LIBS_LINKING:BOOL=ON \
		-DGDCM_INSTALL_LIB_DIR:STRING=lib/$(DEB_HOST_MULTIARCH) \
		-DGDCM_USE_VTK:BOOL=ON \
		-DVTK_JAVA_JAR=/usr/share/java/vtk6.jar


override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)

override_dh_auto_build-indep: 
	dh_auto_build -- DoxygenDoc

override_dh_auto_build-arch: 
	dh_auto_build 

override_dh_auto_install-arch:
	# See #664188
	sed -i -e "s/FATAL_ERROR/STATUS/g" obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-2.6/GDCMTargets-*.cmake
	# See #711214
	sed -i -e "s/FATAL_ERROR/STATUS/g" obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-2.6/GDCMTargets.cmake
	dh_auto_install
	# PHP
	#mkdir -p debian/tmp/$(PHP_EX)
	#mkdir -p debian/tmp/usr/share/php
	#mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gdcm.php debian/tmp/usr/share/php
	#mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gdcm.so debian/tmp/$(PHP_EX)
	#mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtkgdcm.php debian/tmp/usr/share/php
	#mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtkgdcm.so debian/tmp/$(PHP_EX)
	#echo "php:Depends=phpapi-`php-config5 --phpapi`" >> debian/php5-gdcm.substvars
	#echo "php:Depends=phpapi-`php-config5 --phpapi`" >> debian/php5-vtkgdcm.substvars

	# Python
	mv debian/tmp/usr/lib/python debian/tmp/$(PYMODDIR)
	#mv debian/tmp/usr/lib/_gdcmswig.so* debian/tmp/$(PYMODDIR)/dist-packages/

override_dh_auto_install-indep: 
	DESTDIR=$(CURDIR)/debian/tmp/ $(MAKE) -C obj-*/Utilities/doxygen/ install 

#override_dh_auto_install-arch:
#	dh_install --list-missing

override_dh_strip:
	dh_strip --dbg-package=libgdcm2.6-dbg

override_dh_strip_nondeterminism:
	dh_strip_nondeterminism -Xsharp 

override_dh_clideps:
ifeq ($(DEB_WRAP_CSHARP), 1)
	dh_clideps
endif

# No tests needed for docs
override_dh_auto_test-indep:

pkg_doc = gdcm-doc
pkg_exa = gdcm-examples

override_dh_compress:
	# do not compress .map file for doxygen graph
	dh_compress -X.map -X.pdf

#TODO I cannot set documentation to separate build target as man page
# depends on doc, and bin tools depends on man page

debian/control: debian/control.in
	sed -e"s/@PYVER@/$(PYVER)/g" -e "s/@DEB_MONO_ARCHS@/$(DEB_MONO_ARCHS)/g" $< > $@

get-orig-source:
	uscan --verbose --force-download --rename