]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- more 3rdparty files for wechat_qrcode
[packages/opencv.git] / opencv.spec
1 # TODO:
2 # - contrib subpackage(s)
3 # - contrib BRs:
4 #   opencv_contrib-3.1.0/modules/cnn_3dobj/CMakeLists.txt:find_package(Caffe)
5 #   opencv_contrib-3.1.0/modules/sfm/CMakeLists.txt:find_package(Ceres QUIET)
6 # unpackaged (4.5.5)
7 #/usr/share/OpenCV/3rdparty/usr/lib64/libcorrespondence.a
8 #/usr/share/OpenCV/3rdparty/usr/lib64/libmultiview.a
9 #/usr/share/OpenCV/3rdparty/usr/lib64/libnumeric.a
10 #/usr/share/OpenCV/valgrind.supp
11 #/usr/share/OpenCV/valgrind_3rdparty.supp
12
13 #
14 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
15 # - CUDA, CUFFT, CUBLAS, NVCUVID support (on bcond)
16 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
17 #
18 # Conditional build:
19 # - general options:
20 %bcond_with     tbb             # Threading Building Blocks support (everywhere)
21 %bcond_with     sse             # use SSE instructions
22 %bcond_with     sse2            # use SSE2 instructions
23 %bcond_with     sse3            # use SSE3 instructions
24 %bcond_with     ssse3           # use SSSE3 instructions
25 %bcond_with     sse41           # use SSE4.1 instructions
26 %bcond_with     sse42           # use SSE4.2 instructions
27 %bcond_with     avx             # use AVX instructions
28 %bcond_without  opencl          # OpenCL support
29 %bcond_with     opencl_amdblas  # AMD OpenCL BLAS routines
30 %bcond_with     opencl_amdfft   # AMD OpenCL FFT routines
31 %bcond_without  opengl          # OpenGL support
32 %bcond_without  openmp          # OpenMP support (available when not using tbb)
33 %bcond_without  examples        # Install examples
34 # - bindings
35 %bcond_without  java            # Java binding
36 # - highgui options:
37 %bcond_without  ffmpeg          # FFMpeg support in highgui
38 %bcond_without  gstreamer       # GStreamer support in highgui
39 %bcond_with     openni          # OpenNI (Natural Interaction) support in highgui
40 %bcond_with     pvapi           # PvAPI (AVT GigE cameras) support in highgui (proprietary)
41 %bcond_with     qt              # Qt backend instead of GTK+ in highgui
42 %bcond_with     unicap          # Unicap support in highgui (GPL)
43 %bcond_without  v4l             # Video4Linux in highgui
44 %bcond_with     ximea           # m3API (XIMEA cameras) support in highgui (proprietary)
45 %bcond_with     xine            # XINE support in highgui (GPL)
46 # - other modules
47 %bcond_without  vtk             # VTK library support (opencv_viz module)
48
49 %ifarch pentium3 pentium4 %{x8664} x32
50 %define         with_sse        1
51 %endif
52 %ifarch pentium4 %{x8664} x32
53 %define         with_sse2       1
54 %endif
55 Summary:        A library of programming functions mainly aimed at real time computer vision
56 Summary(pl.UTF-8):      Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
57 Name:           opencv
58 Version:        4.5.5
59 Release:        1
60 Epoch:          1
61 %if %{with unicap} || %{with xine}
62 License:        GPL (enforced by used libraries), BSD (opencv itself)
63 %else
64 License:        BSD
65 %endif
66 Group:          Libraries
67 Source0:        https://github.com/Itseez/opencv/archive/%{version}/%{name}-%{version}.tar.gz
68 # Source0-md5:  a9782f01883fcf51451a183d05bda33d
69 Source1:        https://github.com/Itseez/opencv_contrib/archive/%{version}/%{name}_contrib-%{version}.tar.gz
70 # Source1-md5:  073793e8085ec2490b3386e04ee20fbc
71 # See opencv_contrib-3.4.1/modules/xfeatures2d/cmake/download_boostdesc.cmake
72 Source10:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i
73 # Source10-md5: 0ea90e7a8f3f7876d450e4149c97c74f
74 Source11:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i
75 # Source11-md5: 232c966b13651bd0e46a1497b0852191
76 Source12:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i
77 # Source12-md5: 324426a24fa56ad9c5b8e3e0b3e5303e
78 Source13:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i
79 # Source13-md5: 202e1b3e9fec871b04da31f7f016679f
80 Source14:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i
81 # Source14-md5: 98ea99d399965c03d555cef3ea502a0b
82 Source15:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i
83 # Source15-md5: e6dcfa9f647779eb1ce446a8d759b6ea
84 Source16:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i
85 # Source16-md5: 0ae0675534aa318d9668f2a179c2a052
86 # See opencv_contrib-3.4.1/modules/xfeatures2d/cmake/download_vgg.cmake
87 Source20:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i
88 # Source20-md5: e8d0dcd54d1bcfdc29203d011a797179
89 Source21:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i
90 # Source21-md5: 7126a5d9a8884ebca5aea5d63d677225
91 Source22:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i
92 # Source22-md5: 7cd47228edec52b6d82f46511af325c5
93 Source23:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i
94 # Source23-md5: 151805e03568c9f490a5e3a872777b75
95 # See opencv_contrib-3.4.1/modules/face/CMakeLists.txt
96 Source30:       https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat
97 # Source30-md5: 7505c44ca4eb54b4ab1e4777cb96ac05
98 # See opencv-4.5.1/modules/gapi/cmake/DownloadADE.cmake
99 Source40:       https://github.com/opencv/ade/archive/v0.1.2a/ade-0.1.2a.zip
100 # Source40-md5: fa4b3e25167319cb0fa9432ef8281945
101 # See opencv_contrib-4.5.5/modules/wechat_qrcode/CMakeLists.txt
102 Source50:       https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/detect.caffemodel
103 # Source50-md5: 238e2b2d6f3c18d6c3a30de0c31e23cf
104 Source51:       https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/detect.prototxt
105 # Source51-md5: 6fb4976b32695f9f5c6305c19f12537d
106 Source52:       https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/sr.caffemodel
107 # Source52-md5: cbfcd60361a73beb8c583eea7e8e6664
108 Source53:       https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/sr.prototxt
109 # Source53-md5: 69db99927a70df953b471daaba03fbef
110 Patch0:         %{name}-ximea.patch
111 Patch1:         python-install.patch
112 Patch2:         pkgconfig-paths.patch
113 Patch3:         no-cxx-in-c-header.patch
114 Patch4:         gcc11.patch
115 Patch5:         %{name}-ade.patch
116 URL:            http://www.opencv.org/
117 %{?with_pvapi:BuildRequires:    AVT_GigE_SDK-devel}
118 %{?with_opencl:BuildRequires:   OpenCL-devel}
119 BuildRequires:  OpenEXR-devel
120 %{?with_opengl:BuildRequires:   OpenGL-GLU-devel}
121 %if %{with opengl}
122 BuildRequires:  OpenGL-devel
123 BuildRequires:  libglvnd-libGL-devel
124 %endif
125 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
126 %{?with_openni:BuildRequires:   OpenNI-devel}
127 %{?with_ximea:BuildRequires:    XIMEA-devel >= 4}
128 %{?with_java:BuildRequires:     ant}
129 BuildRequires:  boost-devel
130 %{?with_opencl_amdblas:BuildRequires:   clAmdBlas-devel}
131 %{?with_opencl_amdfft:BuildRequires:    clAmdFft-devel}
132 BuildRequires:  cmake >= 3.5.1
133 BuildRequires:  doxygen
134 BuildRequires:  eigen3 >= 3
135 %{?with_ffmpeg:BuildRequires:   ffmpeg-devel >= 0.7}
136 %{?with_openmp:BuildRequires:   gcc-c++ >= 6:4.2}
137 BuildRequires:  gflags-devel
138 BuildRequires:  gl2ps-devel
139 BuildRequires:  glog-devel
140 %if %{with gstreamer}
141 BuildRequires:  gstreamer-devel >= 1.0
142 BuildRequires:  gstreamer-plugins-base-devel >= 1.0
143 %endif
144 BuildRequires:  jasper-devel
145 %if %{with java}
146 BuildRequires:  jdk
147 BuildRequires:  java-xerces
148 %endif
149 BuildRequires:  khrplatform-devel
150 BuildRequires:  libdc1394-devel >= 2
151 %{?with_openmp:BuildRequires:   libgomp-devel}
152 BuildRequires:  libjpeg-devel
153 BuildRequires:  libpng-devel
154 BuildRequires:  libraw1394-devel
155 BuildRequires:  libstdc++-devel
156 BuildRequires:  libtiff-devel
157 BuildRequires:  libtool
158 %if %{with unicap}
159 BuildRequires:  libucil-devel
160 BuildRequires:  libunicap-devel
161 %endif
162 BuildRequires:  libv4l-devel
163 BuildRequires:  ogre-devel
164 BuildRequires:  pkgconfig
165 BuildRequires:  hdf5-devel
166 BuildRequires:  protobuf-devel
167 BuildRequires:  python >= 1:2.7
168 BuildRequires:  python-devel >= 1:2.7
169 BuildRequires:  python-numpy-devel
170 BuildRequires:  python3 >= 1:3.2
171 BuildRequires:  python3-devel >= 1:3.2
172 BuildRequires:  python3-numpy-devel
173 BuildRequires:  rpm-build >= 4.6
174 BuildRequires:  rpm-pythonprov
175 BuildRequires:  rpmbuild(macros) >= 1.606
176 BuildRequires:  sed >= 4.0
177 BuildRequires:  sphinx-pdg
178 BuildRequires:  swig-python
179 %{?with_tbb:BuildRequires:      tbb-devel}
180 BuildRequires:  tesseract-devel
181 %if %{with vtk}
182 BuildRequires:  vtk-devel >= 5.8.0
183 BuildRequires:  vtk-java >= 5.8.0
184 BuildRequires:  vtk-python3-devel >= 5.8.0
185 %endif
186 %{?with_xine:BuildRequires:     xine-lib-devel}
187 BuildRequires:  xorg-lib-libX11-devel
188 BuildRequires:  zlib-devel >= 1.2.3
189 %if %{with qt}
190 BuildRequires:  QtCore-devel >= 4
191 BuildRequires:  QtGui-devel >= 4
192 %{?with_opengl:BuildRequires:   QtOpenGL-devel >= 4}
193 BuildRequires:  qt4-qmake >= 4
194 %else
195 BuildRequires:  gtk+2-devel >= 2.0
196 %{?with_opengl:BuildRequires:   gtkglext-devel >= 1.0}
197 %endif
198 Requires:       %{name}-core = %{epoch}:%{version}-%{release}
199 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
200
201 %define         jver    %(echo %{version} | cut -d. -f1-3 | tr -d .)
202 %define         sover   405
203
204 %description
205 OpenCV (Open Source Computer Vision) is a library of programming
206 functions mainly aimed at real time computer vision.
207
208 Example applications of the OpenCV library are:
209 - Human-Computer Interaction (HCI)
210 - Object Identification, Segmentation and Recognition
211 - Face Recognition
212 - Gesture Recognition
213 - Motion Tracking
214 - Ego Motion, Motion Understanding
215 - Structure From Motion (SFM)
216 - Stereo and Multi-Camera Calibration and Depth Computation
217 - Mobile Robotics.
218
219 %description -l pl.UTF-8
220 OpenCV (Open Source Computer Vision) to biblioteka funkcji
221 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
222
223 Przykładowe zastosowania biblioteki OpenCV to
224 - interakcje człowiek-komputer (HCI)
225 - identyfikacja, segmentacja i rozpoznawanie obiektów
226 - rozpoznawanie twarzy
227 - rozpoznawanie gestów
228 - śledzenie ruchu
229 - rozumienie ruchu
230 - SFM (Structure From Motion)
231 - kalibracja dwu- i wielokamerowa, obliczanie głębi
232 - robotyka ruchu.
233
234 %package core
235 Summary:        OpenCV core libraries
236 Summary(pl.UTF-8):      Podstawowe biblioteki OpenCV
237 Group:          Libraries
238 Conflicts:      opencv < 2.4.6.2-1
239
240 %description core
241 This package contains the OpenCV C/C++ core libraries.
242
243 %description core -l pl.UTF-8
244 Ten pakiet zawiera podstawowe biblioteki C/C++ OpenCV.
245
246 %package viz
247 Summary:        OpenCV viz library (VTK support)
248 Summary(pl.UTF-8):      Biblioteka OpenCV viz (obsługa VTK)
249 Group:          Libraries
250 Requires:       %{name} = %{epoch}:%{version}-%{release}
251
252 %description viz
253 OpenCV viz library (VTK support).
254
255 %description viz -l pl.UTF-8
256 Biblioteka OpenCV viz (obsługa VTK).
257
258 %package devel
259 Summary:        Header files for OpenCV library
260 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
261 Group:          Development/Libraries
262 Requires:       %{name} = %{epoch}:%{version}-%{release}
263 %if %{with vtk}
264 Requires:       %{name}-viz = %{epoch}:%{version}-%{release}
265 %endif
266 Obsoletes:      opencv-static < 1:2
267
268 %description devel
269 Header files for OpenCV library.
270
271 %description devel -l pl.UTF-8
272 Pliki nagłówkowe biblioteki OpenCV.
273
274 %package doc
275 Summary:        Manual for OpenCV
276 Summary(fr.UTF-8):      Documentation pour OpenCV
277 Summary(it.UTF-8):      Documentazione di OpenCV
278 Summary(pl.UTF-8):      Podręcznik dla OpenCV
279 Group:          Documentation
280 BuildArch:      noarch
281
282 %description doc
283 Documentation for OpenCV.
284
285 %description doc -l fr.UTF-8
286 Documentation pour OpenCV.
287
288 %description doc -l it.UTF-8
289 Documentazione di OpenCV.
290
291 %description doc -l pl.UTF-8
292 Dokumentacja do OpenCV.
293
294 %package examples
295 Summary:        OpenCV code examples
296 Summary(pl.UTF-8):      Przykłady kodu OpenCV
297 Group:          Documentation
298 BuildArch:      noarch
299
300 %description examples
301 OpenCV code examples.
302
303 %description examples -l pl.UTF-8
304 Przykłady kodu OpenCV.
305
306 %package -n java-opencv
307 Summary:        OpenCV Java bindings
308 Summary(pl.UTF-8):      Wiązania Javy do OpenCV
309 Group:          Libraries/Java
310 Requires:       %{name} = %{epoch}:%{version}-%{release}
311 Requires:       jre
312
313 %description -n java-opencv
314 OpenCV Java bindings.
315
316 %description -n java-opencv -l pl.UTF-8
317 Wiązania Javy do OpenCV.
318
319 %package -n python-opencv
320 Summary:        OpenCV Python 2 bindings
321 Summary(pl.UTF-8):      Wiązania Pythona 2 do OpenCV
322 Group:          Libraries/Python
323 Requires:       %{name} = %{epoch}:%{version}-%{release}
324 Requires:       python-libs >= 1:2.7
325
326 %description -n python-opencv
327 OpenCV Python 2 bindings.
328
329 %description -n python-opencv -l pl.UTF-8
330 Wiązania Pythona 2 do OpenCV.
331
332 %package -n python3-opencv
333 Summary:        OpenCV Python 3 bindings
334 Summary(pl.UTF-8):      Wiązania Pythona 3 do OpenCV
335 Group:          Libraries/Python
336 Requires:       %{name} = %{epoch}:%{version}-%{release}
337 Requires:       python3-libs
338
339 %description -n python3-opencv
340 OpenCV Python 3 bindings.
341
342 %description -n python3-opencv -l pl.UTF-8
343 Wiązania Pythona 3 do OpenCV.
344
345 %prep
346 %setup -q -a1
347
348 %undos CMakeLists.txt
349
350 %patch0 -p1
351 %patch1 -p1
352 %patch2 -p1
353 %patch3 -p1
354 %patch4 -p1
355 %patch5 -p1
356
357 cache_file() {
358         f="$1"
359         d="$2"
360         md5="$(md5sum "$f" | awk '{print $1}')"
361         file="$(basename "$f")"
362         mkdir -p ".cache/$d"
363         ln -s --relative "$f" ".cache/$d/$md5-$file"
364 }
365 for f in %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} %{SOURCE16}; do
366         cache_file $f xfeatures2d/boostdesc
367 done
368 for f in %{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23}; do
369         cache_file $f xfeatures2d/vgg
370 done
371 cache_file %{SOURCE30} data
372 cache_file %{SOURCE40} ade
373 for f in %{SOURCE50} %{SOURCE51} %{SOURCE52} %{SOURCE53}; do
374         cache_file $f wechat_qrcode
375 done
376
377 cd opencv_contrib-%{version}
378
379 # both files use Glog_FOUND variable, but set different variables for LIBS; unify them so they won't disturb each other
380 cp -f modules/sfm/cmake/FindGlog.cmake modules/cnn_3dobj/FindGlog.cmake
381 %{__sed} -i -e 's/Glog_LIBS/GLOG_LIBRARIES/' modules/cnn_3dobj/CMakeLists.txt
382
383 %build
384 mkdir -p build
385 cd build
386
387 # handle cmake & ccache
388 # http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec
389 if [[ "%{__cc}" = *ccache* ]]; then
390         cc="%{__cc}"
391         cxx="%{__cxx}"
392         ccache="
393         -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \
394         -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \
395         "
396 fi
397
398 # WITH_GTK_2_X=ON: force gtk+2 instead of gtk+3
399 # (as of 4.5.5, OpenGL is not supported with gtk+3, leading to highgui linking errors)
400 %cmake .. \
401         $ccache \
402         -DOpenGL_GL_PREFERENCE=GLVND \
403         -DENABLE_PRECOMPILED_HEADERS=OFF \
404         -DOPENCV_LIB_INSTALL_PATH=%{_libdir} \
405         -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \
406         -DENABLE_AVX=%{?with_avx:ON}%{!?with_avx:OFF} \
407         -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
408         -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
409         -DENABLE_SSE3=%{?with_sse3:ON}%{!?with_sse3:OFF} \
410         -DENABLE_SSSE3=%{?with_ssse3:ON}%{!?with_ssse3:OFF} \
411         -DENABLE_SSE41=%{?with_sse41:ON}%{!?with_sse41:OFF} \
412         -DENABLE_SSE42=%{?with_sse42:ON}%{!?with_sse42:OFF} \
413         -DBUILD_NEW_PYTHON_SUPPORT=ON \
414         -DOPENCV_GENERATE_PKGCONFIG:BOOL=ON \
415 %if %{with examples}
416         -DINSTALL_C_EXAMPLES=ON \
417         -DINSTALL_PYTHON_EXAMPLES=ON \
418 %endif
419         %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
420         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
421         -DWITH_GTK_2_X=ON \
422         %{?with_opencl:-DWITH_OPENCL=ON} \
423         %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \
424         %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \
425         %{?with_opengl:-DWITH_OPENGL=ON} \
426         %{?with_openmp:-DWITH_OPENMP=ON} \
427         %{?with_openni:-DWITH_OPENNI=ON} \
428         %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
429         %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
430         %{?with_tbb:-DWITH_TBB=ON} \
431         %{?with_unicap:-DWITH_UNICAP=ON} \
432         %{!?with_v4l:-DWITH_V4L=OFF} \
433         %{?with_vtk:-DWITH_VTK=ON} \
434         %{?with_ximea:-DWITH_XIMEA=ON} \
435         %{?with_xine:-DWITH_XINE=ON} \
436         -DWITH_IPP=OFF
437
438 %{__make}
439
440 %install
441 rm -rf $RPM_BUILD_ROOT
442 %{__make} -C build install \
443         DESTDIR=$RPM_BUILD_ROOT
444
445 %if %{with examples}
446 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
447 mv $RPM_BUILD_ROOT%{_datadir}/opencv4/samples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
448 %endif
449
450 # disable completeness check incompatible with split packaging
451 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d' $RPM_BUILD_ROOT%{_libdir}/cmake/opencv4/OpenCVModules.cmake
452
453 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
454 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
455 %py_postclean
456
457 %if %{with java}
458 # move to proper directories, create symlink
459 install -d $RPM_BUILD_ROOT%{_javadir}
460 %{__mv} $RPM_BUILD_ROOT%{_javadir}/opencv4/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
461 sed -i -e 's#/share/java/opencv4/libopencv_java%{jver}\.so#/%{_lib}/libopencv_java%{jver}.so#g' \
462         $RPM_BUILD_ROOT%{_libdir}/cmake/opencv4/OpenCVModules-pld.cmake
463 %{__mv} $RPM_BUILD_ROOT%{_javadir}/opencv4/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
464 rmdir $RPM_BUILD_ROOT%{_javadir}/opencv4
465 ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
466 %endif
467
468 %clean
469 rm -rf $RPM_BUILD_ROOT
470
471 %post   -p /sbin/ldconfig
472 %postun -p /sbin/ldconfig
473
474 %post   core -p /sbin/ldconfig
475 %postun core -p /sbin/ldconfig
476
477 %post   viz -p /sbin/ldconfig
478 %postun viz -p /sbin/ldconfig
479
480 %post   -n java-opencv -p /sbin/ldconfig
481 %postun -n java-opencv -p /sbin/ldconfig
482
483 %files
484 %defattr(644,root,root,755)
485 %attr(755,root,root) %{_bindir}/opencv_annotation
486 %attr(755,root,root) %{_bindir}/opencv_interactive-calibration
487 %attr(755,root,root) %{_bindir}/opencv_model_diagnostics
488 %attr(755,root,root) %{_bindir}/opencv_version
489 %attr(755,root,root) %{_bindir}/opencv_visualisation
490 %attr(755,root,root) %{_bindir}/setup_vars_opencv4.sh
491 %attr(755,root,root) %{_libdir}/libopencv_calib3d.so.*.*.*
492 %attr(755,root,root) %ghost %{_libdir}/libopencv_calib3d.so.%{sover}
493 %attr(755,root,root) %{_libdir}/libopencv_dnn.so.*.*.*
494 %attr(755,root,root) %ghost %{_libdir}/libopencv_dnn.so.%{sover}
495 %attr(755,root,root) %{_libdir}/libopencv_features2d.so.*.*.*
496 %attr(755,root,root) %ghost %{_libdir}/libopencv_features2d.so.%{sover}
497 %attr(755,root,root) %{_libdir}/libopencv_gapi.so.*.*.*
498 %attr(755,root,root) %ghost %{_libdir}/libopencv_gapi.so.%{sover}
499 %attr(755,root,root) %{_libdir}/libopencv_highgui.so.*.*.*
500 %attr(755,root,root) %ghost %{_libdir}/libopencv_highgui.so.%{sover}
501 %attr(755,root,root) %{_libdir}/libopencv_objdetect.so.*.*.*
502 %attr(755,root,root) %ghost %{_libdir}/libopencv_objdetect.so.%{sover}
503 %attr(755,root,root) %{_libdir}/libopencv_stitching.so.*.*.*
504 %attr(755,root,root) %ghost %{_libdir}/libopencv_stitching.so.%{sover}
505 %attr(755,root,root) %{_libdir}/libopencv_superres.so.*.*.*
506 %attr(755,root,root) %ghost %{_libdir}/libopencv_superres.so.%{sover}
507 %attr(755,root,root) %{_libdir}/libopencv_videostab.so.*.*.*
508 %attr(755,root,root) %ghost %{_libdir}/libopencv_videostab.so.%{sover}
509 # contrib modules
510 %attr(755,root,root) %{_bindir}/opencv_waldboost_detector
511 %attr(755,root,root) %ghost %{_libdir}/libopencv_alphamat.so.%{sover}
512 %attr(755,root,root) %{_libdir}/libopencv_alphamat.so.*.*.*
513 %attr(755,root,root) %ghost %{_libdir}/libopencv_aruco.so.%{sover}
514 %attr(755,root,root) %{_libdir}/libopencv_aruco.so.*.*.*
515 %attr(755,root,root) %ghost %{_libdir}/libopencv_barcode.so.%{sover}
516 %attr(755,root,root) %{_libdir}/libopencv_barcode.so.*.*.*
517 %attr(755,root,root) %ghost %{_libdir}/libopencv_bgsegm.so.%{sover}
518 %attr(755,root,root) %{_libdir}/libopencv_bgsegm.so.*.*.*
519 %attr(755,root,root) %ghost %{_libdir}/libopencv_bioinspired.so.%{sover}
520 %attr(755,root,root) %{_libdir}/libopencv_bioinspired.so.*.*.*
521 %attr(755,root,root) %ghost %{_libdir}/libopencv_ccalib.so.%{sover}
522 %attr(755,root,root) %{_libdir}/libopencv_ccalib.so.*.*.*
523 %attr(755,root,root) %ghost %{_libdir}/libopencv_datasets.so.%{sover}
524 %attr(755,root,root) %{_libdir}/libopencv_datasets.so.*.*.*
525 %attr(755,root,root) %ghost %{_libdir}/libopencv_dnn_objdetect.so.%{sover}
526 %attr(755,root,root) %{_libdir}/libopencv_dnn_objdetect.so.*.*.*
527 %attr(755,root,root) %ghost %{_libdir}/libopencv_dnn_superres.so.%{sover}
528 %attr(755,root,root) %{_libdir}/libopencv_dnn_superres.so.*.*.*
529 %attr(755,root,root) %ghost %{_libdir}/libopencv_dpm.so.%{sover}
530 %attr(755,root,root) %{_libdir}/libopencv_dpm.so.*.*.*
531 %attr(755,root,root) %ghost %{_libdir}/libopencv_face.so.%{sover}
532 %attr(755,root,root) %{_libdir}/libopencv_face.so.*.*.*
533 %attr(755,root,root) %ghost %{_libdir}/libopencv_freetype.so.%{sover}
534 %attr(755,root,root) %{_libdir}/libopencv_freetype.so.*.*.*
535 %attr(755,root,root) %ghost %{_libdir}/libopencv_fuzzy.so.%{sover}
536 %attr(755,root,root) %{_libdir}/libopencv_fuzzy.so.*.*.*
537 %attr(755,root,root) %ghost %{_libdir}/libopencv_hdf.so.%{sover}
538 %attr(755,root,root) %{_libdir}/libopencv_hdf.so.*.*.*
539 %attr(755,root,root) %ghost %{_libdir}/libopencv_hfs.so.%{sover}
540 %attr(755,root,root) %{_libdir}/libopencv_hfs.so.*.*.*
541 %attr(755,root,root) %ghost %{_libdir}/libopencv_img_hash.so.%{sover}
542 %attr(755,root,root) %{_libdir}/libopencv_img_hash.so.*.*.*
543 %attr(755,root,root) %ghost %{_libdir}/libopencv_intensity_transform.so.%{sover}
544 %attr(755,root,root) %{_libdir}/libopencv_intensity_transform.so.*.*.*
545 %attr(755,root,root) %ghost %{_libdir}/libopencv_line_descriptor.so.%{sover}
546 %attr(755,root,root) %{_libdir}/libopencv_line_descriptor.so.*.*.*
547 %attr(755,root,root) %ghost %{_libdir}/libopencv_mcc.so.%{sover}
548 %attr(755,root,root) %{_libdir}/libopencv_mcc.so.*.*.*
549 %attr(755,root,root) %ghost %{_libdir}/libopencv_ovis.so.%{sover}
550 %attr(755,root,root) %{_libdir}/libopencv_ovis.so.*.*.*
551 %attr(755,root,root) %ghost %{_libdir}/libopencv_optflow.so.%{sover}
552 %attr(755,root,root) %{_libdir}/libopencv_optflow.so.*.*.*
553 %attr(755,root,root) %ghost %{_libdir}/libopencv_phase_unwrapping.so.%{sover}
554 %attr(755,root,root) %{_libdir}/libopencv_phase_unwrapping.so.*.*.*
555 %attr(755,root,root) %ghost %{_libdir}/libopencv_plot.so.%{sover}
556 %attr(755,root,root) %{_libdir}/libopencv_plot.so.*.*.*
557 %attr(755,root,root) %ghost %{_libdir}/libopencv_quality.so.%{sover}
558 %attr(755,root,root) %{_libdir}/libopencv_quality.so.*.*.*
559 %attr(755,root,root) %ghost %{_libdir}/libopencv_rapid.so.%{sover}
560 %attr(755,root,root) %{_libdir}/libopencv_rapid.so.*.*.*
561 %attr(755,root,root) %ghost %{_libdir}/libopencv_reg.so.%{sover}
562 %attr(755,root,root) %{_libdir}/libopencv_reg.so.*.*.*
563 %attr(755,root,root) %ghost %{_libdir}/libopencv_rgbd.so.%{sover}
564 %attr(755,root,root) %{_libdir}/libopencv_rgbd.so.*.*.*
565 %attr(755,root,root) %ghost %{_libdir}/libopencv_saliency.so.%{sover}
566 %attr(755,root,root) %{_libdir}/libopencv_saliency.so.*.*.*
567 %attr(755,root,root) %ghost %{_libdir}/libopencv_shape.so.%{sover}
568 %attr(755,root,root) %{_libdir}/libopencv_shape.so.*.*.*
569 %attr(755,root,root) %ghost %{_libdir}/libopencv_sfm.so.%{sover}
570 %attr(755,root,root) %{_libdir}/libopencv_sfm.so.*.*.*
571 %attr(755,root,root) %ghost %{_libdir}/libopencv_stereo.so.%{sover}
572 %attr(755,root,root) %{_libdir}/libopencv_stereo.so.*.*.*
573 %attr(755,root,root) %ghost %{_libdir}/libopencv_structured_light.so.%{sover}
574 %attr(755,root,root) %{_libdir}/libopencv_structured_light.so.*.*.*
575 %attr(755,root,root) %ghost %{_libdir}/libopencv_surface_matching.so.%{sover}
576 %attr(755,root,root) %{_libdir}/libopencv_surface_matching.so.*.*.*
577 %attr(755,root,root) %ghost %{_libdir}/libopencv_text.so.%{sover}
578 %attr(755,root,root) %{_libdir}/libopencv_text.so.*.*.*
579 %attr(755,root,root) %ghost %{_libdir}/libopencv_tracking.so.%{sover}
580 %attr(755,root,root) %{_libdir}/libopencv_tracking.so.*.*.*
581 %attr(755,root,root) %ghost %{_libdir}/libopencv_wechat_qrcode.so.%{sover}
582 %attr(755,root,root) %{_libdir}/libopencv_wechat_qrcode.so.*.*.*
583 %attr(755,root,root) %ghost %{_libdir}/libopencv_xfeatures2d.so.%{sover}
584 %attr(755,root,root) %{_libdir}/libopencv_xfeatures2d.so.*.*.*
585 %attr(755,root,root) %ghost %{_libdir}/libopencv_ximgproc.so.%{sover}
586 %attr(755,root,root) %{_libdir}/libopencv_ximgproc.so.*.*.*
587 %attr(755,root,root) %ghost %{_libdir}/libopencv_xobjdetect.so.%{sover}
588 %attr(755,root,root) %{_libdir}/libopencv_xobjdetect.so.*.*.*
589 %attr(755,root,root) %ghost %{_libdir}/libopencv_xphoto.so.%{sover}
590 %attr(755,root,root) %{_libdir}/libopencv_xphoto.so.*.*.*
591
592 %dir %{_datadir}/opencv4
593 %{_datadir}/opencv4/haarcascades
594 %{_datadir}/opencv4/lbpcascades
595 %{_datadir}/opencv4/quality
596
597 %files core
598 %defattr(644,root,root,755)
599 %attr(755,root,root) %{_libdir}/libopencv_core.so.*.*.*
600 %attr(755,root,root) %ghost %{_libdir}/libopencv_core.so.%{sover}
601 %attr(755,root,root) %{_libdir}/libopencv_flann.so.*.*.*
602 %attr(755,root,root) %ghost %{_libdir}/libopencv_flann.so.%{sover}
603 %attr(755,root,root) %{_libdir}/libopencv_imgcodecs.so.*.*.*
604 %attr(755,root,root) %ghost %{_libdir}/libopencv_imgcodecs.so.%{sover}
605 %attr(755,root,root) %{_libdir}/libopencv_imgproc.so.*.*.*
606 %attr(755,root,root) %ghost %{_libdir}/libopencv_imgproc.so.%{sover}
607 %attr(755,root,root) %{_libdir}/libopencv_ml.so.*.*.*
608 %attr(755,root,root) %ghost %{_libdir}/libopencv_ml.so.%{sover}
609 %attr(755,root,root) %{_libdir}/libopencv_photo.so.*.*.*
610 %attr(755,root,root) %ghost %{_libdir}/libopencv_photo.so.%{sover}
611 %attr(755,root,root) %{_libdir}/libopencv_video.so.*.*.*
612 %attr(755,root,root) %ghost %{_libdir}/libopencv_video.so.%{sover}
613 %attr(755,root,root) %{_libdir}/libopencv_videoio.so.*.*.*
614 %attr(755,root,root) %ghost %{_libdir}/libopencv_videoio.so.%{sover}
615
616 %if %{with vtk}
617 %files viz
618 %defattr(644,root,root,755)
619 %attr(755,root,root) %{_libdir}/libopencv_viz.so.*.*.*
620 %attr(755,root,root) %ghost %{_libdir}/libopencv_viz.so.%{sover}
621 %endif
622
623 %files devel
624 %defattr(644,root,root,755)
625 # core
626 %{_libdir}/libopencv_core.so
627 %{_libdir}/libopencv_dnn.so
628 %{_libdir}/libopencv_flann.so
629 %{_libdir}/libopencv_imgcodecs.so
630 %{_libdir}/libopencv_imgproc.so
631 %{_libdir}/libopencv_ml.so
632 %{_libdir}/libopencv_photo.so
633 %{_libdir}/libopencv_video.so
634 %{_libdir}/libopencv_videoio.so
635 # GUI/extensions (base package)
636 %{_libdir}/libopencv_calib3d.so
637 %{_libdir}/libopencv_features2d.so
638 %{_libdir}/libopencv_gapi.so
639 %{_libdir}/libopencv_highgui.so
640 %{_libdir}/libopencv_objdetect.so
641 %{_libdir}/libopencv_stitching.so
642 # contrib
643 %{_libdir}/libopencv_alphamat.so
644 %{_libdir}/libopencv_aruco.so
645 %{_libdir}/libopencv_barcode.so
646 %{_libdir}/libopencv_bgsegm.so
647 %{_libdir}/libopencv_bioinspired.so
648 %{_libdir}/libopencv_ccalib.so
649 %{_libdir}/libopencv_datasets.so
650 %{_libdir}/libopencv_dnn_objdetect.so
651 %{_libdir}/libopencv_dnn_superres.so
652 %{_libdir}/libopencv_dpm.so
653 %{_libdir}/libopencv_face.so
654 %{_libdir}/libopencv_freetype.so
655 %{_libdir}/libopencv_fuzzy.so
656 %{_libdir}/libopencv_hdf.so
657 %{_libdir}/libopencv_hfs.so
658 %{_libdir}/libopencv_img_hash.so
659 %{_libdir}/libopencv_intensity_transform.so
660 %{_libdir}/libopencv_line_descriptor.so
661 %{_libdir}/libopencv_mcc.so
662 %{_libdir}/libopencv_optflow.so
663 %{_libdir}/libopencv_ovis.so
664 %{_libdir}/libopencv_phase_unwrapping.so
665 %{_libdir}/libopencv_plot.so
666 %{_libdir}/libopencv_quality.so
667 %{_libdir}/libopencv_rapid.so
668 %{_libdir}/libopencv_reg.so
669 %{_libdir}/libopencv_rgbd.so
670 %{_libdir}/libopencv_saliency.so
671 %{_libdir}/libopencv_sfm.so
672 %{_libdir}/libopencv_shape.so
673 %{_libdir}/libopencv_stereo.so
674 %{_libdir}/libopencv_superres.so
675 %{_libdir}/libopencv_structured_light.so
676 %{_libdir}/libopencv_surface_matching.so
677 %{_libdir}/libopencv_text.so
678 %{_libdir}/libopencv_tracking.so
679 %{_libdir}/libopencv_videostab.so
680 %{_libdir}/libopencv_wechat_qrcode.so
681 %{_libdir}/libopencv_xfeatures2d.so
682 %{_libdir}/libopencv_ximgproc.so
683 %{_libdir}/libopencv_xobjdetect.so
684 %{_libdir}/libopencv_xphoto.so
685 # viz
686 %if %{with vtk}
687 %{_libdir}/libopencv_viz.so
688 %endif
689 %{_includedir}/opencv4
690 %dir %{_libdir}/cmake/opencv4
691 %{_libdir}/cmake/opencv4/OpenCV*.cmake
692 %{_pkgconfigdir}/opencv4.pc
693
694 %files doc
695 %defattr(644,root,root,755)
696 # TODO: probably could rebuild them and package via make install
697 %doc doc/*
698
699 %if %{with examples}
700 %files examples
701 %defattr(644,root,root,755)
702 %{_examplesdir}/%{name}-%{version}
703 %endif
704
705 %if %{with java}
706 %files -n java-opencv
707 %defattr(644,root,root,755)
708 %attr(755,root,root) %{_libdir}/libopencv_java%{jver}.so
709 %{_javadir}/opencv-%{jver}.jar
710 %{_javadir}/opencv.jar
711 %endif
712
713 %files -n python-opencv
714 %defattr(644,root,root,755)
715 %dir %{py_sitedir}/cv2
716 %dir %{py_sitedir}/cv2/python-*
717 %attr(755,root,root) %{py_sitedir}/cv2/python-*/cv2.so
718 %{py_sitedir}/cv2/*.py[co]
719 %{py_sitedir}/cv2/mat_wrapper
720 %{py_sitedir}/cv2/misc
721 %{py_sitedir}/cv2/utils
722
723 %files -n python3-opencv
724 %defattr(644,root,root,755)
725 %dir %{py3_sitedir}/cv2
726 %dir %{py3_sitedir}/cv2/python-*
727 %attr(755,root,root) %{py3_sitedir}/cv2/python-*/cv2.cpython-*.so
728 %{py3_sitedir}/cv2/*.py
729 %{py3_sitedir}/cv2/gapi
730 %{py3_sitedir}/cv2/mat_wrapper
731 %{py3_sitedir}/cv2/misc
732 %{py3_sitedir}/cv2/utils
This page took 0.092162 seconds and 4 git commands to generate.