]>
Commit | Line | Data |
---|---|---|
8d499a62 | 1 | # TODO: |
ca2adc08 JB |
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/cnn_3dobj/CMakeLists.txt:find_package(Protobuf) | |
6 | # opencv_contrib-3.1.0/modules/cnn_3dobj/CMakeLists.txt:find_package(Glog) | |
7 | # opencv_contrib-3.1.0/modules/hdf/CMakeLists.txt:find_package(HDF5) | |
8 | # opencv_contrib-3.1.0/modules/sfm/CMakeLists.txt:find_package(Ceres QUIET) | |
9 | # opencv_contrib-3.1.0/modules/text/CMakeLists.txt:find_package(Tesseract) | |
09d132a9 ER |
10 | # unpackaged (3.4.0) |
11 | #/usr/share/OpenCV/3rdparty/usr/lib64/libcorrespondence.a | |
12 | #/usr/share/OpenCV/3rdparty/usr/lib64/libmultiview.a | |
13 | #/usr/share/OpenCV/3rdparty/usr/lib64/libnumeric.a | |
14 | #/usr/share/OpenCV/valgrind.supp | |
15 | #/usr/share/OpenCV/valgrind_3rdparty.supp | |
16 | ||
ca2adc08 | 17 | # |
2acd8ac1 | 18 | # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?) |
da5d1e09 | 19 | # - CUDA, CUFFT, CUBLAS, NVCUVID support (on bcond) |
5df3cf1b | 20 | # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary) |
a8d52c2e | 21 | # |
0c2d6b7d | 22 | # Conditional build: |
a55ba198 JB |
23 | # - general options: |
24 | %bcond_with tbb # Threading Building Blocks support (everywhere) | |
25 | %bcond_with sse # use SSE instructions | |
26 | %bcond_with sse2 # use SSE2 instructions | |
da5d1e09 JB |
27 | %bcond_with sse3 # use SSE3 instructions |
28 | %bcond_with ssse3 # use SSSE3 instructions | |
29 | %bcond_with sse41 # use SSE4.1 instructions | |
30 | %bcond_with sse42 # use SSE4.2 instructions | |
31 | %bcond_with avx # use AVX instructions | |
8d5385eb JB |
32 | %bcond_without opencl # OpenCL support |
33 | %bcond_with opencl_amdblas # AMD OpenCL BLAS routines | |
34 | %bcond_with opencl_amdfft # AMD OpenCL FFT routines | |
35 | %bcond_without opengl # OpenGL support | |
4a401ecc | 36 | %bcond_without openmp # OpenMP support (available when not using tbb) |
200823d5 | 37 | %bcond_without examples # Install examples |
b07433c6 JB |
38 | # - bindings |
39 | %bcond_without java # Java binding | |
a55ba198 | 40 | # - highgui options: |
b3920a9d | 41 | %bcond_without ffmpeg # FFMpeg support in highgui |
1c9fe580 JB |
42 | %bcond_without gstreamer # GStreamer support in highgui |
43 | %bcond_with openni # OpenNI (Natural Interaction) support in highgui | |
a55ba198 | 44 | %bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary) |
1c9fe580 | 45 | %bcond_with qt # Qt backend instead of GTK+ in highgui |
1c9fe580 | 46 | %bcond_with unicap # Unicap support in highgui (GPL) |
da5d1e09 | 47 | %bcond_without v4l # Video4Linux in highgui |
a55ba198 | 48 | %bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary) |
1c9fe580 | 49 | %bcond_with xine # XINE support in highgui (GPL) |
cf32945e JB |
50 | # - other modules |
51 | %bcond_without vtk # VTK library support (opencv_viz module) | |
a4737151 | 52 | |
e36ac029 | 53 | %ifarch pentium3 pentium4 %{x8664} x32 |
1c9fe580 JB |
54 | %define with_sse 1 |
55 | %endif | |
e36ac029 | 56 | %ifarch pentium4 %{x8664} x32 |
1c9fe580 JB |
57 | %define with_sse2 1 |
58 | %endif | |
901927d3 | 59 | Summary: A library of programming functions mainly aimed at real time computer vision |
0c2d6b7d | 60 | Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym |
901927d3 | 61 | Name: opencv |
01c6bd4e | 62 | Version: 3.4.1 |
0b593be1 | 63 | Release: 1 |
901927d3 | 64 | Epoch: 1 |
d5e56e66 JB |
65 | %if %{with unicap} || %{with xine} |
66 | License: GPL (enforced by used libraries), BSD (opencv itself) | |
67 | %else | |
901927d3 | 68 | License: BSD |
d5e56e66 | 69 | %endif |
901927d3 | 70 | Group: Libraries |
200823d5 | 71 | Source0: https://github.com/Itseez/opencv/archive/%{version}/%{name}-%{version}.tar.gz |
01c6bd4e | 72 | # Source0-md5: a0b7a47899e67b3490ea31edc4f6e8e6 |
b287af3c | 73 | Source1: https://github.com/Itseez/opencv_contrib/archive/%{version}/%{name}_contrib-%{version}.tar.gz |
01c6bd4e | 74 | # Source1-md5: dd0c63f4185ab8a4829d8154ae382266 |
8a121398 JR |
75 | # See opencv_contrib-3.4.1/modules/xfeatures2d/cmake/download_boostdesc.cmake |
76 | Source10: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i | |
77 | # Source10-md5: 0ea90e7a8f3f7876d450e4149c97c74f | |
78 | Source11: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i | |
79 | # Source11-md5: 232c966b13651bd0e46a1497b0852191 | |
80 | Source12: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i | |
81 | # Source12-md5: 324426a24fa56ad9c5b8e3e0b3e5303e | |
82 | Source13: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i | |
83 | # Source13-md5: 202e1b3e9fec871b04da31f7f016679f | |
84 | Source14: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i | |
85 | # Source14-md5: 98ea99d399965c03d555cef3ea502a0b | |
86 | Source15: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i | |
87 | # Source15-md5: e6dcfa9f647779eb1ce446a8d759b6ea | |
88 | Source16: https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i | |
89 | # Source16-md5: 0ae0675534aa318d9668f2a179c2a052 | |
90 | # See opencv_contrib-3.4.1/modules/xfeatures2d/cmake/download_vgg.cmake | |
91 | Source20: https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i | |
92 | # Source20-md5: e8d0dcd54d1bcfdc29203d011a797179 | |
93 | Source21: https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i | |
94 | # Source21-md5: 7126a5d9a8884ebca5aea5d63d677225 | |
95 | Source22: https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i | |
96 | # Source22-md5: 7cd47228edec52b6d82f46511af325c5 | |
97 | Source23: https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i | |
98 | # Source23-md5: 151805e03568c9f490a5e3a872777b75 | |
454d8108 | 99 | # See opencv_contrib-3.4.1/modules/face/CMakeLists.txt |
8a121398 JR |
100 | Source30: https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat |
101 | # Source30-md5: 7505c44ca4eb54b4ab1e4777cb96ac05 | |
102 | Patch0: ix86-pause.patch | |
08b22f18 | 103 | Patch1: %{name}-ximea.patch |
08b22f18 | 104 | Patch3: cmake-install-path.patch |
200823d5 | 105 | URL: http://www.opencv.org/ |
d5e56e66 | 106 | %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel} |
8d5385eb | 107 | %{?with_opencl:BuildRequires: OpenCL-devel} |
0c2d6b7d | 108 | BuildRequires: OpenEXR-devel |
5df3cf1b | 109 | %{?with_opengl:BuildRequires: OpenGL-GLU-devel} |
9f0b035c | 110 | %{?with_opengl:BuildRequires: OpenGL-devel} |
5df3cf1b | 111 | # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used |
1c9fe580 | 112 | %{?with_openni:BuildRequires: OpenNI-devel} |
da5d1e09 | 113 | %{?with_ximea:BuildRequires: XIMEA-devel >= 4} |
b07433c6 | 114 | %{?with_java:BuildRequires: ant} |
8a121398 | 115 | BuildRequires: boost-devel |
ef4af528 JB |
116 | %{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel} |
117 | %{?with_opencl_amdfft:BuildRequires: clAmdFft-devel} | |
b07433c6 | 118 | BuildRequires: cmake >= 2.8 |
0c2d6b7d | 119 | BuildRequires: doxygen |
809ce413 | 120 | BuildRequires: eigen3 >= 3 |
b3920a9d | 121 | %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7} |
4a401ecc | 122 | %{?with_openmp:BuildRequires: gcc-c++ >= 6:4.2} |
fb5ded39 | 123 | BuildRequires: gflags-devel |
74cbdeb2 | 124 | BuildRequires: gl2ps-devel |
debb38d4 | 125 | BuildRequires: glog-devel |
0c2d6b7d | 126 | %if %{with gstreamer} |
158e0ccc JB |
127 | BuildRequires: gstreamer-devel >= 1.0 |
128 | BuildRequires: gstreamer-plugins-base-devel >= 1.0 | |
0c2d6b7d | 129 | %endif |
901927d3 | 130 | BuildRequires: jasper-devel |
b07433c6 | 131 | %{?with_java:BuildRequires: jdk} |
158e0ccc | 132 | BuildRequires: libdc1394-devel >= 2 |
4a401ecc | 133 | %{?with_openmp:BuildRequires: libgomp-devel} |
901927d3 AM |
134 | BuildRequires: libjpeg-devel |
135 | BuildRequires: libpng-devel | |
136 | BuildRequires: libraw1394-devel | |
0c2d6b7d | 137 | BuildRequires: libstdc++-devel |
901927d3 | 138 | BuildRequires: libtiff-devel |
148338c5 | 139 | BuildRequires: libtool |
d5e56e66 JB |
140 | %if %{with unicap} |
141 | BuildRequires: libucil-devel | |
142 | BuildRequires: libunicap-devel | |
143 | %endif | |
0c2d6b7d | 144 | BuildRequires: libv4l-devel |
af6d2888 | 145 | BuildRequires: pkgconfig |
158e0ccc JB |
146 | BuildRequires: python >= 2.0 |
147 | BuildRequires: python-devel >= 2.0 | |
0c2d6b7d | 148 | BuildRequires: python-numpy-devel |
b221500a JB |
149 | BuildRequires: python3 >= 1:3.2 |
150 | BuildRequires: python3-devel >= 1:3.2 | |
151 | BuildRequires: python3-numpy-devel | |
901927d3 | 152 | BuildRequires: rpm-pythonprov |
8d499a62 | 153 | BuildRequires: rpmbuild(macros) >= 1.606 |
1376dffe | 154 | BuildRequires: sed >= 4.0 |
158e0ccc | 155 | BuildRequires: sphinx-pdg |
996927aa | 156 | BuildRequires: swig-python |
f8e040cc | 157 | %{?with_tbb:BuildRequires: tbb-devel} |
ae3d975d AM |
158 | %if %{with vtk} |
159 | BuildRequires: vtk-devel >= 5.8.0 | |
fba97d16 | 160 | BuildRequires: vtk-java >= 5.8.0 |
ae3d975d AM |
161 | BuildRequires: vtk-tcl >= 5.8.0 |
162 | %endif | |
901927d3 | 163 | %{?with_xine:BuildRequires: xine-lib-devel} |
158e0ccc | 164 | BuildRequires: xorg-lib-libX11-devel |
452b38e1 | 165 | BuildRequires: zlib-devel |
4afb606b | 166 | %if %{with qt} |
4afb606b JB |
167 | BuildRequires: QtCore-devel >= 4 |
168 | BuildRequires: QtGui-devel >= 4 | |
5df3cf1b | 169 | %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4} |
4afb606b JB |
170 | BuildRequires: qt4-qmake >= 4 |
171 | %else | |
172 | BuildRequires: gtk+2-devel >= 2.0 | |
5df3cf1b | 173 | %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0} |
4afb606b | 174 | %endif |
da5d1e09 | 175 | Requires: %{name}-core = %{epoch}:%{version}-%{release} |
901927d3 AM |
176 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
177 | ||
158e0ccc | 178 | %define jver %(echo %{version} | cut -d. -f1-3 | tr -d .) |
71c2eb73 | 179 | %define sover %(echo %{version} | cut -d. -f1-2) |
933de752 | 180 | |
901927d3 AM |
181 | %description |
182 | OpenCV (Open Source Computer Vision) is a library of programming | |
183 | functions mainly aimed at real time computer vision. | |
184 | ||
0c2d6b7d JB |
185 | Example applications of the OpenCV library are: |
186 | - Human-Computer Interaction (HCI) | |
187 | - Object Identification, Segmentation and Recognition | |
188 | - Face Recognition | |
189 | - Gesture Recognition | |
190 | - Motion Tracking | |
191 | - Ego Motion, Motion Understanding | |
192 | - Structure From Motion (SFM) | |
193 | - Stereo and Multi-Camera Calibration and Depth Computation | |
194 | - Mobile Robotics. | |
195 | ||
196 | %description -l pl.UTF-8 | |
197 | OpenCV (Open Source Computer Vision) to biblioteka funkcji | |
198 | przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym. | |
199 | ||
200 | Przykładowe zastosowania biblioteki OpenCV to | |
201 | - interakcje człowiek-komputer (HCI) | |
202 | - identyfikacja, segmentacja i rozpoznawanie obiektów | |
203 | - rozpoznawanie twarzy | |
204 | - rozpoznawanie gestów | |
205 | - śledzenie ruchu | |
206 | - rozumienie ruchu | |
207 | - SFM (Structure From Motion) | |
208 | - kalibracja dwu- i wielokamerowa, obliczanie głębi | |
209 | - robotyka ruchu. | |
901927d3 | 210 | |
933de752 ER |
211 | %package core |
212 | Summary: OpenCV core libraries | |
da5d1e09 | 213 | Summary(pl.UTF-8): Podstawowe biblioteki OpenCV |
933de752 | 214 | Group: Libraries |
da5d1e09 | 215 | Conflicts: opencv < 2.4.6.2-1 |
933de752 ER |
216 | |
217 | %description core | |
218 | This package contains the OpenCV C/C++ core libraries. | |
219 | ||
da5d1e09 JB |
220 | %description core -l pl.UTF-8 |
221 | Ten pakiet zawiera podstawowe biblioteki C/C++ OpenCV. | |
222 | ||
cf32945e JB |
223 | %package viz |
224 | Summary: OpenCV viz library (VTK support) | |
225 | Summary(pl.UTF-8): Biblioteka OpenCV viz (obsługa VTK) | |
226 | Group: Libraries | |
227 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
228 | ||
229 | %description viz | |
230 | OpenCV viz library (VTK support). | |
231 | ||
232 | %description viz -l pl.UTF-8 | |
233 | Biblioteka OpenCV viz (obsługa VTK). | |
234 | ||
901927d3 | 235 | %package devel |
0c2d6b7d JB |
236 | Summary: Header files for OpenCV library |
237 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV | |
901927d3 AM |
238 | Group: Development/Libraries |
239 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
cf32945e JB |
240 | %if %{with vtk} |
241 | Requires: %{name}-viz = %{epoch}:%{version}-%{release} | |
242 | %endif | |
0c2d6b7d | 243 | Obsoletes: opencv-static |
901927d3 AM |
244 | |
245 | %description devel | |
0c2d6b7d | 246 | Header files for OpenCV library. |
901927d3 | 247 | |
0c2d6b7d JB |
248 | %description devel -l pl.UTF-8 |
249 | Pliki nagłówkowe biblioteki OpenCV. | |
901927d3 | 250 | |
9141b1e2 ER |
251 | %package doc |
252 | Summary: Manual for OpenCV | |
253 | Summary(fr.UTF-8): Documentation pour OpenCV | |
254 | Summary(it.UTF-8): Documentazione di OpenCV | |
255 | Summary(pl.UTF-8): Podręcznik dla OpenCV | |
256 | Group: Documentation | |
257 | # noarch subpackages only when building with rpm5 | |
258 | %if "%{_rpmversion}" >= "5" | |
259 | BuildArch: noarch | |
260 | %endif | |
261 | ||
262 | %description doc | |
263 | Documentation for OpenCV. | |
264 | ||
265 | %description doc -l fr.UTF-8 | |
266 | Documentation pour OpenCV. | |
267 | ||
268 | %description doc -l it.UTF-8 | |
269 | Documentazione di OpenCV. | |
270 | ||
271 | %description doc -l pl.UTF-8 | |
272 | Dokumentacja do OpenCV. | |
273 | ||
200823d5 ER |
274 | %package examples |
275 | Summary: OpenCV code examples | |
276 | Group: Documentation | |
277 | %if "%{_rpmversion}" >= "5" | |
278 | BuildArch: noarch | |
279 | %endif | |
280 | ||
281 | %description examples | |
282 | OpenCV code examples. | |
283 | ||
b07433c6 JB |
284 | %package -n java-opencv |
285 | Summary: OpenCV Java bindings | |
286 | Summary(pl.UTF-8): Wiązania Javy do OpenCV | |
287 | Group: Libraries/Java | |
288 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
289 | Requires: jre | |
290 | ||
291 | %description -n java-opencv | |
292 | OpenCV Java bindings. | |
293 | ||
294 | %description -n java-opencv -l pl.UTF-8 | |
295 | Wiązania Javy do OpenCV. | |
296 | ||
901927d3 | 297 | %package -n python-opencv |
b221500a JB |
298 | Summary: OpenCV Python 2 bindings |
299 | Summary(pl.UTF-8): Wiązania Pythona 2 do OpenCV | |
0c2d6b7d | 300 | Group: Libraries/Python |
cd1f0136 | 301 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9f0b035c | 302 | Requires: python-libs |
901927d3 AM |
303 | |
304 | %description -n python-opencv | |
b221500a | 305 | OpenCV Python 2 bindings. |
901927d3 | 306 | |
0c2d6b7d | 307 | %description -n python-opencv -l pl.UTF-8 |
b221500a JB |
308 | Wiązania Pythona 2 do OpenCV. |
309 | ||
310 | %package -n python3-opencv | |
311 | Summary: OpenCV Python 3 bindings | |
312 | Summary(pl.UTF-8): Wiązania Pythona 3 do OpenCV | |
313 | Group: Libraries/Python | |
314 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
315 | Requires: python3-libs | |
316 | ||
317 | %description -n python3-opencv | |
318 | OpenCV Python 3 bindings. | |
319 | ||
320 | %description -n python3-opencv -l pl.UTF-8 | |
321 | Wiązania Pythona 3 do OpenCV. | |
0c2d6b7d | 322 | |
901927d3 | 323 | %prep |
b287af3c | 324 | %setup -q -a1 |
54551f29 | 325 | |
da67222a | 326 | %undos CMakeLists.txt |
54551f29 | 327 | |
8a121398 | 328 | %patch0 -p1 |
08b22f18 | 329 | %patch1 -p1 |
01c6bd4e | 330 | %patch3 -p1 |
148338c5 | 331 | |
901927d3 | 332 | %build |
8a121398 | 333 | install -d build/{share/OpenCV/testdata/cv/face,downloads/xfeatures2d} |
95daeb66 | 334 | cd build |
ea26b025 | 335 | |
8a121398 JR |
336 | install %{SOURCE30} share/OpenCV/testdata/cv/face/ |
337 | install %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} %{SOURCE16} downloads/xfeatures2d/ | |
338 | install %{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23} downloads/xfeatures2d/ | |
339 | ||
ea26b025 ER |
340 | # handle cmake & ccache |
341 | # http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec | |
342 | if [[ "%{__cc}" = *ccache* ]]; then | |
343 | cc="%{__cc}" | |
344 | cxx="%{__cxx}" | |
345 | ccache=" | |
346 | -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \ | |
347 | -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \ | |
348 | " | |
349 | fi | |
350 | ||
0c2d6b7d | 351 | %cmake .. \ |
ea26b025 | 352 | $ccache \ |
08b22f18 | 353 | -DENABLE_PRECOMPILED_HEADERS=OFF \ |
09d132a9 | 354 | -DOPENCV_LIB_INSTALL_PATH=%{_libdir} \ |
b287af3c | 355 | -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \ |
da5d1e09 | 356 | -DENABLE_AVX=%{?with_avx:ON}%{!?with_avx:OFF} \ |
1c9fe580 JB |
357 | -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \ |
358 | -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \ | |
da5d1e09 JB |
359 | -DENABLE_SSE3=%{?with_sse3:ON}%{!?with_sse3:OFF} \ |
360 | -DENABLE_SSSE3=%{?with_ssse3:ON}%{!?with_ssse3:OFF} \ | |
361 | -DENABLE_SSE41=%{?with_sse41:ON}%{!?with_sse41:OFF} \ | |
362 | -DENABLE_SSE42=%{?with_sse42:ON}%{!?with_sse42:OFF} \ | |
95daeb66 | 363 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ |
200823d5 ER |
364 | %if %{with examples} |
365 | -DINSTALL_C_EXAMPLES=ON \ | |
366 | -DINSTALL_PYTHON_EXAMPLES=ON \ | |
367 | %endif | |
b3920a9d | 368 | %{?with_ffmpeg:-DWITH_FFMPEG=ON} \ |
d5e56e66 | 369 | %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \ |
8d5385eb | 370 | %{?with_opencl:-DWITH_OPENCL=ON} \ |
faf80a1c JB |
371 | %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \ |
372 | %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \ | |
5df3cf1b | 373 | %{?with_opengl:-DWITH_OPENGL=ON} \ |
4a401ecc | 374 | %{?with_openmp:-DWITH_OPENMP=ON} \ |
1c9fe580 | 375 | %{?with_openni:-DWITH_OPENNI=ON} \ |
809ce413 | 376 | %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \ |
5df3cf1b | 377 | %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \ |
f8e040cc | 378 | %{?with_tbb:-DWITH_TBB=ON} \ |
d5e56e66 | 379 | %{?with_unicap:-DWITH_UNICAP=ON} \ |
ed358224 | 380 | %{!?with_v4l:-DWITH_V4L=OFF} \ |
cf32945e | 381 | %{?with_vtk:-DWITH_VTK=ON} \ |
a55ba198 | 382 | %{?with_ximea:-DWITH_XIMEA=ON} \ |
33a5389a JR |
383 | %{?with_xine:-DWITH_XINE=ON} \ |
384 | -DWITH_IPP=OFF | |
54551f29 | 385 | |
8b9f61f7 | 386 | %{__make} |
901927d3 AM |
387 | |
388 | %install | |
389 | rm -rf $RPM_BUILD_ROOT | |
95daeb66 | 390 | %{__make} -C build install \ |
901927d3 AM |
391 | DESTDIR=$RPM_BUILD_ROOT |
392 | ||
200823d5 ER |
393 | %if %{with examples} |
394 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
395 | mv $RPM_BUILD_ROOT%{_datadir}/OpenCV/samples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
396 | %endif | |
9141b1e2 | 397 | |
4bd2eae7 | 398 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} |
a4737151 | 399 | cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir} |
4bd2eae7 | 400 | |
7545129b JB |
401 | # disable completeness check incompatible with split packaging |
402 | %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d' $RPM_BUILD_ROOT%{_datadir}/OpenCV/OpenCVModules.cmake | |
403 | ||
8d499a62 JB |
404 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
405 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
406 | %py_postclean | |
407 | ||
b07433c6 JB |
408 | %if %{with java} |
409 | # move to proper directories, create symlink | |
410 | install -d $RPM_BUILD_ROOT%{_javadir} | |
411 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir} | |
c3075463 AM |
412 | sed -i -e 's#/share/OpenCV/java/libopencv_java%{jver}\.so#/%{_lib}/libopencv_java%{jver}.so#g' \ |
413 | $RPM_BUILD_ROOT%{_datadir}/OpenCV/OpenCVModules-pld.cmake | |
b07433c6 JB |
414 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir} |
415 | rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java | |
416 | ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar | |
417 | %endif | |
418 | ||
901927d3 AM |
419 | %clean |
420 | rm -rf $RPM_BUILD_ROOT | |
421 | ||
422 | %post -p /sbin/ldconfig | |
423 | %postun -p /sbin/ldconfig | |
424 | ||
933de752 ER |
425 | %post core -p /sbin/ldconfig |
426 | %postun core -p /sbin/ldconfig | |
427 | ||
485d5dca JB |
428 | %post viz -p /sbin/ldconfig |
429 | %postun viz -p /sbin/ldconfig | |
430 | ||
b07433c6 JB |
431 | %post -n java-opencv -p /sbin/ldconfig |
432 | %postun -n java-opencv -p /sbin/ldconfig | |
433 | ||
901927d3 AM |
434 | %files |
435 | %defattr(644,root,root,755) | |
f753ced4 | 436 | %attr(755,root,root) %{_bindir}/opencv_annotation |
933de752 | 437 | %attr(755,root,root) %{_bindir}/opencv_createsamples |
09d132a9 | 438 | %attr(755,root,root) %{_bindir}/opencv_interactive-calibration |
933de752 | 439 | %attr(755,root,root) %{_bindir}/opencv_traincascade |
09d132a9 ER |
440 | %attr(755,root,root) %{_bindir}/opencv_version |
441 | %attr(755,root,root) %{_bindir}/opencv_visualisation | |
158e0ccc | 442 | %attr(755,root,root) %{_libdir}/libopencv_calib3d.so.*.*.* |
71c2eb73 | 443 | %attr(755,root,root) %ghost %{_libdir}/libopencv_calib3d.so.%{sover} |
158e0ccc | 444 | %attr(755,root,root) %{_libdir}/libopencv_features2d.so.*.*.* |
71c2eb73 | 445 | %attr(755,root,root) %ghost %{_libdir}/libopencv_features2d.so.%{sover} |
158e0ccc | 446 | %attr(755,root,root) %{_libdir}/libopencv_highgui.so.*.*.* |
71c2eb73 | 447 | %attr(755,root,root) %ghost %{_libdir}/libopencv_highgui.so.%{sover} |
158e0ccc | 448 | %attr(755,root,root) %{_libdir}/libopencv_objdetect.so.*.*.* |
71c2eb73 | 449 | %attr(755,root,root) %ghost %{_libdir}/libopencv_objdetect.so.%{sover} |
158e0ccc | 450 | %attr(755,root,root) %{_libdir}/libopencv_stitching.so.*.*.* |
71c2eb73 | 451 | %attr(755,root,root) %ghost %{_libdir}/libopencv_stitching.so.%{sover} |
158e0ccc | 452 | %attr(755,root,root) %{_libdir}/libopencv_superres.so.*.*.* |
71c2eb73 | 453 | %attr(755,root,root) %ghost %{_libdir}/libopencv_superres.so.%{sover} |
158e0ccc | 454 | %attr(755,root,root) %{_libdir}/libopencv_videostab.so.*.*.* |
71c2eb73 | 455 | %attr(755,root,root) %ghost %{_libdir}/libopencv_videostab.so.%{sover} |
b287af3c JR |
456 | # contrib modules |
457 | %attr(755,root,root) %{_bindir}/opencv_waldboost_detector | |
458 | %attr(755,root,root) %ghost %{_libdir}/libopencv_aruco.so.%{sover} | |
459 | %attr(755,root,root) %{_libdir}/libopencv_aruco.so.*.*.* | |
460 | %attr(755,root,root) %ghost %{_libdir}/libopencv_bgsegm.so.%{sover} | |
461 | %attr(755,root,root) %{_libdir}/libopencv_bgsegm.so.*.*.* | |
462 | %attr(755,root,root) %ghost %{_libdir}/libopencv_bioinspired.so.%{sover} | |
463 | %attr(755,root,root) %{_libdir}/libopencv_bioinspired.so.*.*.* | |
464 | %attr(755,root,root) %ghost %{_libdir}/libopencv_ccalib.so.%{sover} | |
465 | %attr(755,root,root) %{_libdir}/libopencv_ccalib.so.*.*.* | |
466 | %attr(755,root,root) %ghost %{_libdir}/libopencv_datasets.so.%{sover} | |
467 | %attr(755,root,root) %{_libdir}/libopencv_datasets.so.*.*.* | |
468 | %attr(755,root,root) %ghost %{_libdir}/libopencv_dnn.so.%{sover} | |
469 | %attr(755,root,root) %{_libdir}/libopencv_dnn.so.*.*.* | |
c9cb1c24 JR |
470 | %attr(755,root,root) %ghost %{_libdir}/libopencv_dnn_objdetect.so.%{sover} |
471 | %attr(755,root,root) %{_libdir}/libopencv_dnn_objdetect.so.*.*.* | |
b287af3c JR |
472 | %attr(755,root,root) %ghost %{_libdir}/libopencv_dpm.so.%{sover} |
473 | %attr(755,root,root) %{_libdir}/libopencv_dpm.so.*.*.* | |
474 | %attr(755,root,root) %ghost %{_libdir}/libopencv_face.so.%{sover} | |
475 | %attr(755,root,root) %{_libdir}/libopencv_face.so.*.*.* | |
09d132a9 ER |
476 | %attr(755,root,root) %ghost %{_libdir}/libopencv_freetype.so.%{sover} |
477 | %attr(755,root,root) %{_libdir}/libopencv_freetype.so.*.*.* | |
b287af3c JR |
478 | %attr(755,root,root) %ghost %{_libdir}/libopencv_fuzzy.so.%{sover} |
479 | %attr(755,root,root) %{_libdir}/libopencv_fuzzy.so.*.*.* | |
480 | %attr(755,root,root) %ghost %{_libdir}/libopencv_hdf.so.%{sover} | |
481 | %attr(755,root,root) %{_libdir}/libopencv_hdf.so.*.*.* | |
c9cb1c24 JR |
482 | %attr(755,root,root) %ghost %{_libdir}/libopencv_hfs.so.%{sover} |
483 | %attr(755,root,root) %{_libdir}/libopencv_hfs.so.*.*.* | |
09d132a9 ER |
484 | %attr(755,root,root) %ghost %{_libdir}/libopencv_img_hash.so.%{sover} |
485 | %attr(755,root,root) %{_libdir}/libopencv_img_hash.so.*.*.* | |
b287af3c JR |
486 | %attr(755,root,root) %ghost %{_libdir}/libopencv_line_descriptor.so.%{sover} |
487 | %attr(755,root,root) %{_libdir}/libopencv_line_descriptor.so.*.*.* | |
488 | %attr(755,root,root) %ghost %{_libdir}/libopencv_optflow.so.%{sover} | |
489 | %attr(755,root,root) %{_libdir}/libopencv_optflow.so.*.*.* | |
09d132a9 ER |
490 | %attr(755,root,root) %ghost %{_libdir}/libopencv_phase_unwrapping.so.%{sover} |
491 | %attr(755,root,root) %{_libdir}/libopencv_phase_unwrapping.so.*.*.* | |
b287af3c JR |
492 | %attr(755,root,root) %ghost %{_libdir}/libopencv_plot.so.%{sover} |
493 | %attr(755,root,root) %{_libdir}/libopencv_plot.so.*.*.* | |
494 | %attr(755,root,root) %ghost %{_libdir}/libopencv_reg.so.%{sover} | |
495 | %attr(755,root,root) %{_libdir}/libopencv_reg.so.*.*.* | |
496 | %attr(755,root,root) %ghost %{_libdir}/libopencv_rgbd.so.%{sover} | |
497 | %attr(755,root,root) %{_libdir}/libopencv_rgbd.so.*.*.* | |
498 | %attr(755,root,root) %ghost %{_libdir}/libopencv_saliency.so.%{sover} | |
499 | %attr(755,root,root) %{_libdir}/libopencv_saliency.so.*.*.* | |
500 | %attr(755,root,root) %ghost %{_libdir}/libopencv_sfm.so.%{sover} | |
501 | %attr(755,root,root) %{_libdir}/libopencv_sfm.so.*.*.* | |
502 | %attr(755,root,root) %ghost %{_libdir}/libopencv_stereo.so.%{sover} | |
503 | %attr(755,root,root) %{_libdir}/libopencv_stereo.so.*.*.* | |
504 | %attr(755,root,root) %ghost %{_libdir}/libopencv_structured_light.so.%{sover} | |
505 | %attr(755,root,root) %{_libdir}/libopencv_structured_light.so.*.*.* | |
506 | %attr(755,root,root) %ghost %{_libdir}/libopencv_surface_matching.so.%{sover} | |
507 | %attr(755,root,root) %{_libdir}/libopencv_surface_matching.so.*.*.* | |
508 | %attr(755,root,root) %ghost %{_libdir}/libopencv_text.so.%{sover} | |
509 | %attr(755,root,root) %{_libdir}/libopencv_text.so.*.*.* | |
510 | %attr(755,root,root) %ghost %{_libdir}/libopencv_tracking.so.%{sover} | |
511 | %attr(755,root,root) %{_libdir}/libopencv_tracking.so.*.*.* | |
512 | %attr(755,root,root) %ghost %{_libdir}/libopencv_xfeatures2d.so.%{sover} | |
513 | %attr(755,root,root) %{_libdir}/libopencv_xfeatures2d.so.*.*.* | |
514 | %attr(755,root,root) %ghost %{_libdir}/libopencv_ximgproc.so.%{sover} | |
515 | %attr(755,root,root) %{_libdir}/libopencv_ximgproc.so.*.*.* | |
516 | %attr(755,root,root) %ghost %{_libdir}/libopencv_xobjdetect.so.%{sover} | |
517 | %attr(755,root,root) %{_libdir}/libopencv_xobjdetect.so.*.*.* | |
518 | %attr(755,root,root) %ghost %{_libdir}/libopencv_xphoto.so.%{sover} | |
519 | %attr(755,root,root) %{_libdir}/libopencv_xphoto.so.*.*.* | |
09d132a9 | 520 | |
452b38e1 | 521 | %dir %{_datadir}/OpenCV |
452b38e1 | 522 | %{_datadir}/OpenCV/haarcascades |
523 | %{_datadir}/OpenCV/lbpcascades | |
901927d3 | 524 | |
933de752 ER |
525 | %files core |
526 | %defattr(644,root,root,755) | |
158e0ccc | 527 | %attr(755,root,root) %{_libdir}/libopencv_core.so.*.*.* |
71c2eb73 | 528 | %attr(755,root,root) %ghost %{_libdir}/libopencv_core.so.%{sover} |
158e0ccc | 529 | %attr(755,root,root) %{_libdir}/libopencv_flann.so.*.*.* |
71c2eb73 | 530 | %attr(755,root,root) %ghost %{_libdir}/libopencv_flann.so.%{sover} |
158e0ccc | 531 | %attr(755,root,root) %{_libdir}/libopencv_imgproc.so.*.*.* |
71c2eb73 | 532 | %attr(755,root,root) %ghost %{_libdir}/libopencv_imgproc.so.%{sover} |
158e0ccc | 533 | %attr(755,root,root) %{_libdir}/libopencv_ml.so.*.*.* |
71c2eb73 | 534 | %attr(755,root,root) %ghost %{_libdir}/libopencv_ml.so.%{sover} |
158e0ccc | 535 | %attr(755,root,root) %{_libdir}/libopencv_photo.so.*.*.* |
71c2eb73 | 536 | %attr(755,root,root) %ghost %{_libdir}/libopencv_photo.so.%{sover} |
158e0ccc | 537 | %attr(755,root,root) %{_libdir}/libopencv_video.so.*.*.* |
71c2eb73 | 538 | %attr(755,root,root) %ghost %{_libdir}/libopencv_video.so.%{sover} |
33a5389a | 539 | %attr(755,root,root) %{_libdir}/libopencv_imgcodecs.so.*.*.* |
71c2eb73 | 540 | %attr(755,root,root) %ghost %{_libdir}/libopencv_imgcodecs.so.%{sover} |
33a5389a | 541 | %attr(755,root,root) %{_libdir}/libopencv_shape.so.*.*.* |
71c2eb73 | 542 | %attr(755,root,root) %ghost %{_libdir}/libopencv_shape.so.%{sover} |
33a5389a | 543 | %attr(755,root,root) %{_libdir}/libopencv_videoio.so.*.*.* |
71c2eb73 | 544 | %attr(755,root,root) %ghost %{_libdir}/libopencv_videoio.so.%{sover} |
cf32945e JB |
545 | |
546 | %if %{with vtk} | |
547 | %files viz | |
548 | %defattr(644,root,root,755) | |
158e0ccc | 549 | %attr(755,root,root) %{_libdir}/libopencv_viz.so.*.*.* |
71c2eb73 | 550 | %attr(755,root,root) %ghost %{_libdir}/libopencv_viz.so.%{sover} |
cf32945e | 551 | %endif |
933de752 | 552 | |
901927d3 AM |
553 | %files devel |
554 | %defattr(644,root,root,755) | |
cf32945e JB |
555 | # core |
556 | %attr(755,root,root) %{_libdir}/libopencv_core.so | |
557 | %attr(755,root,root) %{_libdir}/libopencv_flann.so | |
558 | %attr(755,root,root) %{_libdir}/libopencv_imgproc.so | |
559 | %attr(755,root,root) %{_libdir}/libopencv_ml.so | |
560 | %attr(755,root,root) %{_libdir}/libopencv_photo.so | |
561 | %attr(755,root,root) %{_libdir}/libopencv_video.so | |
562 | # GUI/extensions (base package) | |
563 | %attr(755,root,root) %{_libdir}/libopencv_calib3d.so | |
cf32945e | 564 | %attr(755,root,root) %{_libdir}/libopencv_features2d.so |
cf32945e | 565 | %attr(755,root,root) %{_libdir}/libopencv_highgui.so |
cf32945e | 566 | %attr(755,root,root) %{_libdir}/libopencv_objdetect.so |
cf32945e JB |
567 | %attr(755,root,root) %{_libdir}/libopencv_stitching.so |
568 | %attr(755,root,root) %{_libdir}/libopencv_superres.so | |
cf32945e | 569 | %attr(755,root,root) %{_libdir}/libopencv_videostab.so |
33a5389a JR |
570 | %attr(755,root,root) %{_libdir}/libopencv_imgcodecs.so |
571 | %attr(755,root,root) %{_libdir}/libopencv_shape.so | |
572 | %attr(755,root,root) %{_libdir}/libopencv_videoio.so | |
b287af3c JR |
573 | # contrib |
574 | %attr(755,root,root) %{_libdir}/libopencv_aruco.so | |
575 | %attr(755,root,root) %{_libdir}/libopencv_bgsegm.so | |
576 | %attr(755,root,root) %{_libdir}/libopencv_bioinspired.so | |
577 | %attr(755,root,root) %{_libdir}/libopencv_ccalib.so | |
578 | %attr(755,root,root) %{_libdir}/libopencv_datasets.so | |
579 | %attr(755,root,root) %{_libdir}/libopencv_dnn.so | |
c9cb1c24 | 580 | %attr(755,root,root) %{_libdir}/libopencv_dnn_objdetect.so |
b287af3c JR |
581 | %attr(755,root,root) %{_libdir}/libopencv_dpm.so |
582 | %attr(755,root,root) %{_libdir}/libopencv_face.so | |
09d132a9 | 583 | %attr(755,root,root) %{_libdir}/libopencv_freetype.so |
b287af3c JR |
584 | %attr(755,root,root) %{_libdir}/libopencv_fuzzy.so |
585 | %attr(755,root,root) %{_libdir}/libopencv_hdf.so | |
c9cb1c24 | 586 | %attr(755,root,root) %{_libdir}/libopencv_hfs.so |
09d132a9 | 587 | %attr(755,root,root) %{_libdir}/libopencv_img_hash.so |
b287af3c JR |
588 | %attr(755,root,root) %{_libdir}/libopencv_line_descriptor.so |
589 | %attr(755,root,root) %{_libdir}/libopencv_optflow.so | |
09d132a9 | 590 | %attr(755,root,root) %{_libdir}/libopencv_phase_unwrapping.so |
b287af3c JR |
591 | %attr(755,root,root) %{_libdir}/libopencv_plot.so |
592 | %attr(755,root,root) %{_libdir}/libopencv_reg.so | |
593 | %attr(755,root,root) %{_libdir}/libopencv_rgbd.so | |
594 | %attr(755,root,root) %{_libdir}/libopencv_saliency.so | |
595 | %attr(755,root,root) %{_libdir}/libopencv_sfm.so | |
596 | %attr(755,root,root) %{_libdir}/libopencv_stereo.so | |
597 | %attr(755,root,root) %{_libdir}/libopencv_structured_light.so | |
598 | %attr(755,root,root) %{_libdir}/libopencv_surface_matching.so | |
599 | %attr(755,root,root) %{_libdir}/libopencv_text.so | |
600 | %attr(755,root,root) %{_libdir}/libopencv_tracking.so | |
601 | %attr(755,root,root) %{_libdir}/libopencv_xfeatures2d.so | |
602 | %attr(755,root,root) %{_libdir}/libopencv_ximgproc.so | |
603 | %attr(755,root,root) %{_libdir}/libopencv_xobjdetect.so | |
604 | %attr(755,root,root) %{_libdir}/libopencv_xphoto.so | |
09d132a9 | 605 | #%{_libdir}/libopencv_ts.a |
cf32945e JB |
606 | # viz |
607 | %if %{with vtk} | |
608 | %attr(755,root,root) %{_libdir}/libopencv_viz.so | |
0e077f8d | 609 | %endif |
901927d3 | 610 | %{_includedir}/opencv |
509c07dc | 611 | %{_includedir}/opencv2 |
da5d1e09 | 612 | %{_datadir}/OpenCV/OpenCV*.cmake |
0c2d6b7d | 613 | %{_pkgconfigdir}/opencv.pc |
901927d3 | 614 | |
9141b1e2 ER |
615 | %files doc |
616 | %defattr(644,root,root,755) | |
617 | # TODO: probably could rebuild them and package via make install | |
618 | %doc doc/* | |
619 | ||
200823d5 ER |
620 | %if %{with examples} |
621 | %files examples | |
622 | %defattr(644,root,root,755) | |
623 | %{_examplesdir}/%{name}-%{version} | |
624 | %endif | |
625 | ||
b07433c6 JB |
626 | %if %{with java} |
627 | %files -n java-opencv | |
628 | %defattr(644,root,root,755) | |
835e0cdd ER |
629 | %attr(755,root,root) %{_libdir}/libopencv_java%{jver}.so |
630 | %{_javadir}/opencv-%{jver}.jar | |
b07433c6 JB |
631 | %{_javadir}/opencv.jar |
632 | %endif | |
633 | ||
901927d3 AM |
634 | %files -n python-opencv |
635 | %defattr(644,root,root,755) | |
452b38e1 | 636 | %attr(755,root,root) %{py_sitedir}/cv2.so |
b221500a JB |
637 | |
638 | %files -n python3-opencv | |
639 | %defattr(644,root,root,755) | |
640 | %attr(755,root,root) %{py3_sitedir}/cv2.cpython-*.so |