Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # DH_VERBOSE := 1
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6
7 # CamiTK version from d/changelog)
8 include /usr/share/dpkg/pkg-info.mk
9 FULL_VERSION := $(shell echo '$(DEB_VERSION)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
10 VER_MAJOR := $(shell echo '$(FULL_VERSION)' | cut -f1 -d".")
11 VER_MINOR := $(shell echo '$(FULL_VERSION)' | cut -f2 -d".")
12 VER_SHORT=$(VER_MAJOR).$(VER_MINOR)
13
14 # package aliases (see d/control)
15 pkg_lib = libcamitk$(VER_MAJOR)
16 pkg_qpb = libqtpropertybrowser$(VER_MAJOR)
17 pkg_cfg = camitk-config
18 pkg_dev = libcamitk-dev
19 pkg_qpb_dev = libqtpropertybrowser-dev
20 pkg_data = libcamitk$(VER_MAJOR)-data
21 pkg_doc = libcamitk$(VER_MAJOR)-doc
22 pkg_imp = camitk-imp
23 pkg_asm = camitk-actionstatemachine
24 PKG_LIB_DIR := $(CURDIR)/debian/$(pkg_lib)/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)
25 LIB_BUILD_DIR := $(CURDIR)/camitk-build/lib/$(DEB_HOST_MULTIARCH)
26 PRIVATE_LIB_BUILD_DIR := $(LIB_BUILD_DIR)/camitk-$(VER_SHORT)
27
28 # List of python tests that require to install some PyPI packages, they should be not run during packaging
29 # (no execution of code outside the source package)
30 EXCLUDED_PYTHON_TESTS := "'(test-pythonhotplug-image|test-pythonhotplug-mesh|test-pythonhotplug-state|test-pythonhotplug-qt|test-pythonhotplug-meshPoints|test-pythonhotplug-transformationManager|test-pythonhotplug-userScriptValidity|test-pythonhotplug-actionPipeline|test-pythonscript-scriptVariable|test-pythonscript-numpyImageComponent|test-pythonscript-core|test-pythonscript-vtk)'"
31
32 # multi-arch support
33 include /usr/share/dpkg/architecture.mk
34
35 # CMake flags are of two types:
36 # - generic (to tell cmake to build proper binaries)
37 # - CamiTK specific options
38 # Notes:
39 # - if you would like a more verbose camitk at run-time,
40 # you can add -DCAMITK_LOG_LEVEL=2
41 CMAKE_EXTRA_FLAGS = \
42 -DCMAKE_SKIP_RPATH:BOOL=TRUE \
43 -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE \
44 -DCMAKE_BUILD_TYPE:STRING=None \
45 -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
46 \
47 -DCEP_IMAGING:BOOL=TRUE \
48 -DCEP_MODELING:BOOL=TRUE \
49 -DCEP_TUTORIALS:BOOL=TRUE \
50 \
51 -DPYTHON_BINDING:BOOL=TRUE \
52 -DPYTHON_BINDING_TEST_DISABLE:BOOL=TRUE \
53 \
54 -DAPIDOC_SDK:BOOL=TRUE
55
56 # Verbose is required by blhc to remove errors about pre-build of extensiongenerator lib and executable
57 %:
58 VERBOSE=1 QT_QPA_PLATFORM=offscreen dh $@ --builddirectory=camitk-build --with python3
59
60 override_dh_auto_configure:
61 # modify libdir to include multiarch
62 sed -i 's+return "lib";+return "lib/$(DEB_HOST_MULTIARCH)";+g' sdk/libraries/core/CamiTKVersion.h
63 dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
64
65 # let's be smart with doc
66 override_dh_auto_build-indep:
67 # Building API DOC
68 dh_auto_build -- camitk-ce-api-doc
69 # Building all (required to avoid cmake error)
70 dh_auto_build
71
72 # No tests needed for docs
73 override_dh_auto_test-indep:
74 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
75 echo "No tests availaible just for the docs"
76 endif
77
78 # run all the available tests (only for Archictecture: any
79 # as tests can only be run if and once the framework is build)
80 override_dh_auto_test-arch:
81 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
82 # Some tests generate source code and build it but do not receive the hardening flags
83 # As this generated source code do not end up in the distributed binary,
84 # this can be considered as blhc false positive : just ignore them
85 @echo 'blhc: ignore-line-regexp: .*camitk-test-tmp.*'
86 @echo 'blhc: ignore-line-regexp: .*CamiTKExtensionCheck.*'
87 @echo 'blhc: ignore-line-regexp: .*CMakeCXXCompilerABI.cpp.*'
88 # Use the CamiTK test suite
89 # Note: all tests require an X server, xvfb-run is needed to have a virtual one
90 # Another way: xvfb-run --auto-servernum $(MAKE) -C camitk-build ARGS="-V" test
91 # e.g. to test config: (cd camitk-build && xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ctest -VV --timeout 1800 -R application-config)
92 # The build dir path is needed for extensions, public and private libraries during test
93 # to know about all camitk extension directories and properly manage inner-dependencies
94 # between extensions (i.e., mml component extension depends on physicalmodel component extensions)
95 # Lib dependencies can be in any extensions (viewers, component and action extensions) lib directory
96 export LD_LIBRARY_PATH=$(LIB_BUILD_DIR)/:$(PRIVATE_LIB_BUILD_DIR)/viewers/:$(PRIVATE_LIB_BUILD_DIR)/components/:$(PRIVATE_LIB_BUILD_DIR)/actions/:$(PRIVATE_LIB_BUILD_DIR)/ ; \
97 (cd camitk-build && xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ctest -V --timeout 1800 --exclude-regex "$(EXCLUDED_PYTHON_TESTS)")
98 endif
99
100 # packages for specific arch
101 override_dh_install:
102 # $(CURDIR) is the current source dir
103 # camitk dynamic library
104 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkcore.so.*
105 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmonitoring.so.*
106 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkextensiongenerator.so.*
107 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkitktemplates.so.*
108 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/python3/dist-packages/camitk.cpython*.so
109 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/viewers/lib*.so.*
110 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/actions/lib*.so.*
111 dh_install -p$(pkg_lib) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/components/lib*.so.*
112
113 # camitk-config package contains only the app, man page and icon
114 dh_install -p$(pkg_cfg) --autodest debian/tmp/usr/bin/camitk-config
115 dh_install -p$(pkg_cfg) --autodest debian/tmp/usr/share/pixmaps/camitk-config.xpm
116 dh_installman -p$(pkg_cfg) debian/tmp/usr/share/man/man1/camitk-config.1
117
118 # separate packaging for qtpropertybrowser (can be used independently from camitk)
119 dh_install -p$(pkg_qpb) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libqtpropertybrowser.so.*
120
121 # camitk developer package
122 # camitk so and headers and static libs
123 dh_install -p$(pkg_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkcore.so usr/lib/$(DEB_HOST_MULTIARCH)
124 dh_install -p$(pkg_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmonitoring.so usr/lib/$(DEB_HOST_MULTIARCH)
125 dh_install -p$(pkg_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkextensiongenerator.so usr/lib/$(DEB_HOST_MULTIARCH)
126 dh_install -p$(pkg_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcamitkitktemplates.so usr/lib/$(DEB_HOST_MULTIARCH)
127 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/viewers/lib*.so
128 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/actions/lib*.so
129 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/components/lib*.so
130 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/camitk-$(VER_SHORT)/lib*.a
131 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/camitkcore
132 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/cepcoreschema
133 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/cepgenerator
134 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/camitkextensiongenerator
135 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/camitkitktemplates
136 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/viewers
137 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/actions
138 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/components
139 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/pmlschema
140 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/pml
141 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/lmlschema
142 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/lml
143 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/mmlschema
144 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/monitoring
145 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/monitoringgui
146 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/*.cmake
147 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/*.cmake
148 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/camitk/*.cmake
149 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/camitk/manifest/*.cmake
150 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/camitk/packaging/*.cmake
151 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/camitk/test/*.cmake
152 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/cmake/macros/camitk/test/level/*.cmake
153 # wizard
154 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/camitk-wizard
155 dh_installman -p$(pkg_dev) debian/tmp/usr/share/man/man1/camitk-wizard.1
156 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/applications/camitk-wizard.desktop
157 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/share/pixmaps/camitk-wizard.xpm
158 # cepgenerator
159 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/camitk-cepgenerator
160 dh_installman -p$(pkg_dev) debian/tmp/usr/share/man/man1/camitk-cepgenerator.1
161 # extensiongenerator
162 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/camitk-extensiongenerator
163 dh_installman -p$(pkg_dev) debian/tmp/usr/share/man/man1/camitk-extensiongenerator.1
164 # test programs
165 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/camitk-testactions
166 dh_installman -p$(pkg_dev) debian/tmp/usr/share/man/man1/camitk-testactions.1
167 dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/camitk-testcomponents
168 dh_installman -p$(pkg_dev) debian/tmp/usr/share/man/man1/camitk-testcomponents.1
169
170 # qtpropertybrowser so and headers (includes are put directly in usr/include as package should be generic/independant from CamiTK)
171 dh_install -p$(pkg_qpb_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libqtpropertybrowser.so usr/lib/$(DEB_HOST_MULTIARCH)
172 dh_install -p$(pkg_qpb_dev) debian/tmp/usr/include/camitk-$(VER_SHORT)/libraries/qtpropertybrowser usr/include
173
174 # imp
175 dh_install -p$(pkg_imp) --autodest debian/tmp/usr/bin/camitk-imp
176 dh_install -p$(pkg_imp) --autodest debian/tmp/usr/share/applications/camitk-imp.desktop
177 dh_install -p$(pkg_imp) --autodest debian/tmp/usr/share/pixmaps/camitk-imp.xpm
178 dh_installman -p$(pkg_imp) debian/tmp/usr/share/man/man1/camitk-imp.1
179
180 # asm
181 dh_install -p$(pkg_asm) --autodest debian/tmp/usr/bin/camitk-actionstatemachine
182 dh_install -p$(pkg_asm) --autodest debian/tmp/usr/share/applications/camitk-actionstatemachine.desktop
183 dh_install -p$(pkg_asm) --autodest debian/tmp/usr/share/pixmaps/camitk-actionstatemachine.xpm
184 dh_installman -p$(pkg_asm) debian/tmp/usr/share/man/man1/camitk-actionstatemachine.1
185
186 # packages for indep arch
187 # api doc
188 dh_install -p$(pkg_doc) debian/tmp/usr/share/camitk-$(VER_SHORT)/apidoc usr/share/doc/camitk-$(VER_SHORT)
189
190 # all test data excluding extra licence files (everything is already specified in d/c)
191 dh_install -p$(pkg_data) --exclude=LICENSE --autodest debian/tmp/usr/share/camitk-$(VER_SHORT)/testdata
192
193 # required to avoid FTBFS for architecture build all or any
194 override_dh_missing:
195 dh_missing --list-missing
196
197 # dpkg-shlibdeps needs to know about camitk extension directories to manage inner-dependencies
198 # between extensions (i.e., mml component extension depends on physicalmodel component extensions)
199 # Lib dependencies can be in any extensions lib directory (viewers, component and action extensions)
200 override_dh_shlibdeps:
201 dh_shlibdeps -l$(PKG_LIB_DIR)/viewers/:$(PKG_LIB_DIR)/components/:$(PKG_LIB_DIR)/actions/:$(PKG_LIB_DIR)/
202
203 # see http://lists.debian.org/debian-mentors/2012/07/msg00124.html
204 get-orig-source:
205 mkdir -p ../tarballs
206 PERL_LWP_SSL_VERIFY_HOSTNAME=0 uscan --rename --verbose --force-download --destdir=../tarballs