File: rules

package info (click to toggle)
opencv 3.2.0+dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 238,480 kB
  • sloc: xml: 901,650; cpp: 703,419; lisp: 20,142; java: 17,843; python: 17,641; ansic: 603; cs: 601; sh: 516; perl: 494; makefile: 117
file content (141 lines) | stat: -rwxr-xr-x 3,943 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/architecture.mk

BUILDDIR = obj-$(DEB_HOST_MULTIARCH)

# SSE options
ifeq ($(DEB_HOST_ARCH_CPU),amd64)
CMAKE_ARCH_FLAGS = -DENABLE_SSE=ON -DENABLE_SSE2=ON -DENABLE_SSE3=OFF
else
CMAKE_ARCH_FLAGS = -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DENABLE_SSE3=OFF
endif

# TBB support
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x powerpc powerpcspe ppc64 sh4 sparc64))
CMAKE_ARCH_FLAGS += -DWITH_TBB=ON
else
CMAKE_ARCH_FLAGS += -DWITH_TBB=OFF
endif

# Linux-specific stuff
ifeq ($(DEB_HOST_ARCH_OS),linux)
CMAKE_ARCH_FLAGS += -DWITH_1394=ON -DWITH_V4L=ON
else
CMAKE_ARCH_FLAGS += -DWITH_1394=OFF -DWITH_V4L=OFF
endif

# For Java
export JAVA_HOME=/usr/lib/jvm/default-java

CMAKE_FLAGS = \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)" \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \
	-DCMAKE_CXX_FLAGS_RELEASE="$(CXXFLAGS)" \
	-DCMAKE_EXE_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
	-DOPENCV_MATHJAX_RELPATH=/usr/share/javascript/mathjax/ \
	-DCMAKE_BUILD_TYPE=Release	\
	-DBUILD_EXAMPLES=ON	\
	-DINSTALL_C_EXAMPLES=ON	\
	-DINSTALL_PYTHON_EXAMPLES=ON	\
	-DWITH_FFMPEG=ON	\
	-DWITH_GSTREAMER=OFF	\
	-DWITH_GTK=ON	\
	-DWITH_JASPER=OFF	\
	-DWITH_JPEG=ON	\
	-DWITH_PNG=ON	\
	-DWITH_TIFF=ON	\
	-DWITH_OPENEXR=ON \
	-DWITH_PVAPI=ON	\
	-DWITH_UNICAP=OFF	\
	-DWITH_EIGEN=ON \
	-DWITH_VTK=ON \
	-DWITH_GDAL=ON \
	-DWITH_GDCM=ON \
	-DWITH_XINE=OFF	\
	-DWITH_IPP=OFF \
	-DBUILD_TESTS=OFF \
	-DCMAKE_SKIP_RPATH=ON \
	-DWITH_CUDA=OFF \
	-DENABLE_PRECOMPILED_HEADERS=OFF \
	-DWITH_IPP=OFF \
	-DWITH_CAROTENE=OFF \
	-DOPENCL_INCLUDE_DIR:PATH="/usr/include/CL/" \
	-DOPENCV_EXTRA_MODULES_PATH="$(CURDIR)/contrib/modules" \
	$(CMAKE_ARCH_FLAGS)

%:
	dh $@ --with python2,python3,javahelper,jh_maven_repo_helper --parallel

override_dh_clean:
	rm -rvf modules/python/src2/hdr_parser.pyc
	rm -rvf modules/java/generator/rst_parser.pyc
	rm -rvf modules/refman.rst

	dh_clean
	-rm -rvf modules/python/src2/__pycache__

override_dh_auto_clean:
	dh_auto_clean -B $(BUILDDIR)
	dh_auto_clean -B $(BUILDDIR)-static


override_dh_auto_configure: configure_dyn configure_static
configure_dyn:
	dh_auto_configure -B $(BUILDDIR) \
		-- $(CMAKE_FLAGS) \
		-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
		-DBUILD_SHARED_LIBS=ON -DBUILD_DOCS=ON
configure_static:
	dh_auto_configure -B $(BUILDDIR)-static \
		-- $(CMAKE_FLAGS) \
		-DBUILD_SHARED_LIBS=OFF -DBUILD_DOCS=OFF


override_dh_auto_build: build_dyn build_static
build_dyn:
	dh_auto_build -B $(BUILDDIR)
	dh_auto_build -B $(BUILDDIR) -- doxygen
build_static:
	dh_auto_build -B $(BUILDDIR)-static

override_dh_auto_test:

override_dh_auto_install:
	dh_auto_install -B $(BUILDDIR)

override_dh_install:
	# change install path of java library
	sed -i -e "s@share\/OpenCV\/java\/@lib\/jni\/@g" \
		debian/tmp/usr/share/OpenCV/OpenCVModules-release.cmake

	# put the static libs together with the rest of the stuff
	cp -v $(BUILDDIR)-static/lib/*.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/

	rm -vrf debian/tmp/usr/share/OpenCV/doc/html/jquery.js

	find debian/tmp -type d -empty -delete
	dh_install --fail-missing

override_dh_gencontrol:
	dh_numpy
	dh_numpy3
	dh_gencontrol

OCV_CONTRIB = opencv_contrib-3.2.0
PKG = opencv
UVER = $(shell dpkg-parsechangelog -S Version | sed 's,-.*,,')
DTYPE = +dfsg
VER  ?= $(subst $(DTYPE),,$(UVER))
get-orig-source:
	@echo "# OpenCV Downloading..."
	uscan --no-conf --verbose --force-download --download-version $(VER) --no-symlink
	@echo "# Packing..."
	mk-origtargz --repack --compression xz -S $(DTYPE) -C .. ../opencv_$(VER).orig.tar.gz -v $(VER)

	@echo "# OpenCV contrib Downloading..."
	uscan --no-conf --verbose --force-download --download-version $(VER) --no-symlink
	mk-origtargz --repack --compression xz -S $(DTYPE) -C .. ../opencv_$(VER).orig-contrib.tar.gz -v $(VER) -c contrib