1 |
Name: opencv |
2 |
Version: 2.2.0 |
3 |
Release: %mkrel 2 |
4 |
Group: Sciences/Computer science |
5 |
License: GPLv2+ |
6 |
Summary: Open Source Computer Vision library |
7 |
URL: http://opencv.willowgarage.com/wiki/ |
8 |
Source: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/OpenCV-%{version}.tar.bz2 |
9 |
Patch0: OpenCV-2.0.0-link-v4l2.patch |
10 |
Patch1: OpenCV-2.2.0-remove-extra-libs.patch |
11 |
Patch2: OpenCV-2.2-nointernal.patch |
12 |
Patch3: OpenCV-2.2-numpy.patch |
13 |
BuildRequires: cmake |
14 |
BuildRequires: pkgconfig |
15 |
BuildRequires: ffmpeg-devel |
16 |
BuildRequires: gtk2-devel |
17 |
BuildRequires: libgstreamer-devel |
18 |
BuildRequires: libjasper-devel |
19 |
BuildRequires: libjpeg-devel |
20 |
BuildRequires: libpng-devel |
21 |
BuildRequires: libunicap-devel |
22 |
BuildRequires: libv4l-devel |
23 |
BuildRequires: python-devel |
24 |
BuildRequires: OpenEXR-devel |
25 |
BuildRequires: tiff-devel |
26 |
BuildRequires: zlib-devel |
27 |
BuildRequires: lapack-devel |
28 |
BuildRequires: eigen2 |
29 |
BuildRequires: python-numpy-devel |
30 |
|
31 |
%description |
32 |
OpenCV (Open Source Computer Vision) is a library of programming |
33 |
functions for real time computer vision. |
34 |
|
35 |
#-------------------------------------------------------------------------------- |
36 |
|
37 |
%define libopencv_core_soname 2 |
38 |
%define libopencv_core %mklibname opencv_core %{libopencv_core_soname} |
39 |
|
40 |
%package -n %{libopencv_core} |
41 |
Summary: OpenCV core library |
42 |
Group: System/Libraries |
43 |
|
44 |
%description -n %{libopencv_core} |
45 |
OpenCV core library (basic structures, arithmetics and linear algebra, |
46 |
DFT, XML and YAML I/O, etc.). |
47 |
|
48 |
%files -n %{libopencv_core} |
49 |
%defattr(-,root,root,-) |
50 |
%_libdir/libopencv_core.so.%{libopencv_core_soname}* |
51 |
|
52 |
#-------------------------------------------------------------------------------- |
53 |
|
54 |
%define libopencv_imgproc_soname 2 |
55 |
%define libopencv_imgproc %mklibname opencv_imgproc %{libopencv_imgproc_soname} |
56 |
|
57 |
%package -n %{libopencv_imgproc} |
58 |
Summary: OpenCV image processing library |
59 |
Group: System/Libraries |
60 |
Requires: %{libopencv_core} = %{version}-%{release} |
61 |
|
62 |
%description -n %{libopencv_imgproc} |
63 |
OpenCV image processing library (filter, Gaussian blur, erode, dilate, |
64 |
resize, remap, etc.). |
65 |
|
66 |
%files -n %{libopencv_imgproc} |
67 |
%defattr(-,root,root,-) |
68 |
%_libdir/libopencv_imgproc.so.%{libopencv_imgproc_soname}* |
69 |
|
70 |
#-------------------------------------------------------------------------------- |
71 |
|
72 |
%define libopencv_highgui_soname 2 |
73 |
%define libopencv_highgui %mklibname opencv_highgui %{libopencv_highgui_soname} |
74 |
|
75 |
%package -n %{libopencv_highgui} |
76 |
Summary: OpenCV GUI and image/video I/O library |
77 |
Group: System/Libraries |
78 |
Requires: %{libopencv_core} = %{version}-%{release} |
79 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
80 |
|
81 |
%description -n %{libopencv_highgui} |
82 |
OpenCV GUI and image/video I/O library. |
83 |
|
84 |
%files -n %{libopencv_highgui} |
85 |
%defattr(-,root,root,-) |
86 |
%_libdir/libopencv_highgui.so.%{libopencv_highgui_soname}* |
87 |
|
88 |
#-------------------------------------------------------------------------------- |
89 |
|
90 |
%define libopencv_ml_soname 2 |
91 |
%define libopencv_ml %mklibname opencv_ml %{libopencv_ml_soname} |
92 |
|
93 |
%package -n %{libopencv_ml} |
94 |
Summary: OpenCV machine learning model library |
95 |
Group: System/Libraries |
96 |
Requires: %{libopencv_core} = %{version}-%{release} |
97 |
|
98 |
%description -n %{libopencv_ml} |
99 |
OpenCV statistical machine learning models (SVM, |
100 |
decision trees, boosting, etc.). |
101 |
|
102 |
%files -n %{libopencv_ml} |
103 |
%defattr(-,root,root,-) |
104 |
%_libdir/libopencv_ml.so.%{libopencv_ml_soname}* |
105 |
|
106 |
#-------------------------------------------------------------------------------- |
107 |
|
108 |
%define libopencv_flann_soname 2 |
109 |
%define libopencv_flann %mklibname opencv_flann %{libopencv_flann_soname} |
110 |
|
111 |
%package -n %{libopencv_flann} |
112 |
Summary: OpenCV FLANN library |
113 |
Group: System/Libraries |
114 |
|
115 |
%description -n %{libopencv_flann} |
116 |
OpenCV wrappers for the Fast Library for Approximate Neurest Neighbors |
117 |
(FLANN). |
118 |
|
119 |
%files -n %{libopencv_flann} |
120 |
%defattr(-,root,root,-) |
121 |
%_libdir/libopencv_flann.so.%{libopencv_flann_soname}* |
122 |
|
123 |
#-------------------------------------------------------------------------------- |
124 |
|
125 |
%define libopencv_calib3d_soname 2 |
126 |
%define libopencv_calib3d %mklibname opencv_calib3d %{libopencv_calib3d_soname} |
127 |
|
128 |
%package -n %{libopencv_calib3d} |
129 |
Summary: OpenCV camera calibration library |
130 |
Group: System/Libraries |
131 |
Requires: %{libopencv_core} = %{version}-%{release} |
132 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
133 |
|
134 |
%description -n %{libopencv_calib3d} |
135 |
OpenCV library for camera calibration, stereo correspondence, and |
136 |
elements of 3D data processing. |
137 |
|
138 |
%files -n %{libopencv_calib3d} |
139 |
%defattr(-,root,root,-) |
140 |
%_libdir/libopencv_calib3d.so.%{libopencv_calib3d_soname}* |
141 |
|
142 |
#-------------------------------------------------------------------------------- |
143 |
|
144 |
%define libopencv_features2d_soname 2 |
145 |
%define libopencv_features2d %mklibname opencv_features2d %{libopencv_features2d_soname} |
146 |
|
147 |
%package -n %{libopencv_features2d} |
148 |
Summary: OpenCV 2D feature detectors |
149 |
Group: System/Libraries |
150 |
Requires: %{libopencv_core} = %{version}-%{release} |
151 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
152 |
Requires: %{libopencv_calib3d} = %{version}-%{release} |
153 |
Requires: %{libopencv_highgui} = %{version}-%{release} |
154 |
Requires: %{libopencv_flann} = %{version}-%{release} |
155 |
|
156 |
%description -n %{libopencv_features2d} |
157 |
OpenCV 2D feature detectors and descriptors (SURF, FAST, etc.). |
158 |
|
159 |
%files -n %{libopencv_features2d} |
160 |
%defattr(-,root,root,-) |
161 |
%_libdir/libopencv_features2d.so.%{libopencv_features2d_soname}* |
162 |
|
163 |
#-------------------------------------------------------------------------------- |
164 |
|
165 |
%define libopencv_video_soname 2 |
166 |
%define libopencv_video %mklibname opencv_video %{libopencv_video_soname} |
167 |
|
168 |
%package -n %{libopencv_video} |
169 |
Summary: OpenCV motion analysis and object tracking library |
170 |
Group: System/Libraries |
171 |
Requires: %{libopencv_core} = %{version}-%{release} |
172 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
173 |
|
174 |
%description -n %{libopencv_video} |
175 |
OpenCV motion analysis and object tracking library (optical flow, |
176 |
motion templates, background subtraction, etc.). |
177 |
|
178 |
%files -n %{libopencv_video} |
179 |
%defattr(-,root,root,-) |
180 |
%_libdir/libopencv_video.so.%{libopencv_video_soname}* |
181 |
|
182 |
#-------------------------------------------------------------------------------- |
183 |
|
184 |
%define libopencv_objdetect_soname 2 |
185 |
%define libopencv_objdetect %mklibname opencv_objdetect %{libopencv_objdetect_soname} |
186 |
|
187 |
%package -n %{libopencv_objdetect} |
188 |
Summary: OpenCV motion analysis and object tracking library |
189 |
Group: System/Libraries |
190 |
Requires: %{libopencv_core} = %{version}-%{release} |
191 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
192 |
Requires: %{libopencv_highgui} = %{version}-%{release} |
193 |
|
194 |
%description -n %{libopencv_objdetect} |
195 |
OpenCV object detection library (Haar and LBP face detectors, HOG |
196 |
people detector, etc.). |
197 |
|
198 |
%files -n %{libopencv_objdetect} |
199 |
%defattr(-,root,root,-) |
200 |
%_libdir/libopencv_objdetect.so.%{libopencv_objdetect_soname}* |
201 |
|
202 |
#-------------------------------------------------------------------------------- |
203 |
|
204 |
%define libopencv_contrib_soname 2 |
205 |
%define libopencv_contrib %mklibname opencv_contrib %{libopencv_contrib_soname} |
206 |
|
207 |
%package -n %{libopencv_contrib} |
208 |
Summary: OpenCV contributed code library |
209 |
Group: System/Libraries |
210 |
Requires: %{libopencv_core} = %{version}-%{release} |
211 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
212 |
Requires: %{libopencv_calib3d} = %{version}-%{release} |
213 |
Requires: %{libopencv_highgui} = %{version}-%{release} |
214 |
|
215 |
%description -n %{libopencv_contrib} |
216 |
OpenCV contributed code library. |
217 |
|
218 |
%files -n %{libopencv_contrib} |
219 |
%defattr(-,root,root,-) |
220 |
%_libdir/libopencv_contrib.so.%{libopencv_contrib_soname}* |
221 |
|
222 |
#-------------------------------------------------------------------------------- |
223 |
|
224 |
%define libopencv_legacy_soname 2 |
225 |
%define libopencv_legacy %mklibname opencv_legacy %{libopencv_legacy_soname} |
226 |
|
227 |
%package -n %{libopencv_legacy} |
228 |
Summary: OpenCV legacy library |
229 |
Group: System/Libraries |
230 |
Requires: %{libopencv_core} = %{version}-%{release} |
231 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
232 |
Requires: %{libopencv_calib3d} = %{version}-%{release} |
233 |
Requires: %{libopencv_highgui} = %{version}-%{release} |
234 |
Requires: %{libopencv_video} = %{version}-%{release} |
235 |
|
236 |
%description -n %{libopencv_legacy} |
237 |
OpenCV library containing obsolete legacy code. |
238 |
|
239 |
%files -n %{libopencv_legacy} |
240 |
%defattr(-,root,root,-) |
241 |
%_libdir/libopencv_legacy.so.%{libopencv_legacy_soname}* |
242 |
|
243 |
#-------------------------------------------------------------------------------- |
244 |
|
245 |
%package devel |
246 |
Summary: OpenCV development files |
247 |
Group: Development/C |
248 |
Provides: libopencv-devel = %{version}-%{release} |
249 |
Requires: %{libopencv_core} = %{version}-%{release} |
250 |
Requires: %{libopencv_imgproc} = %{version}-%{release} |
251 |
Requires: %{libopencv_highgui} = %{version}-%{release} |
252 |
Requires: %{libopencv_ml} = %{version}-%{release} |
253 |
Requires: %{libopencv_features2d} = %{version}-%{release} |
254 |
Requires: %{libopencv_video} = %{version}-%{release} |
255 |
Requires: %{libopencv_objdetect} = %{version}-%{release} |
256 |
Requires: %{libopencv_calib3d} = %{version}-%{release} |
257 |
Requires: %{libopencv_flann} = %{version}-%{release} |
258 |
Requires: %{libopencv_contrib} = %{version}-%{release} |
259 |
Requires: %{libopencv_legacy} = %{version}-%{release} |
260 |
|
261 |
%description devel |
262 |
OpenCV development files. |
263 |
|
264 |
%files devel |
265 |
%defattr(-,root,root,-) |
266 |
%_libdir/*.so |
267 |
%_includedir/* |
268 |
%_libdir/pkgconfig/* |
269 |
%_datadir/opencv/OpenCVConfig.cmake |
270 |
|
271 |
#-------------------------------------------------------------------------------- |
272 |
|
273 |
%package -n python-opencv |
274 |
Summary: OpenCV Python bindings |
275 |
Group: Development/Python |
276 |
%py_requires -d |
277 |
|
278 |
%description -n python-opencv |
279 |
OpenCV python bindings. |
280 |
|
281 |
%files -n python-opencv |
282 |
%defattr(-,root,root,-) |
283 |
%python_sitearch/* |
284 |
|
285 |
#-------------------------------------------------------------------------------- |
286 |
|
287 |
%package doc |
288 |
Summary: OpenCV docs |
289 |
Group: Books/Computer books |
290 |
|
291 |
%description doc |
292 |
OpenCV docs. |
293 |
|
294 |
%files doc |
295 |
%defattr(-,root,root,-) |
296 |
%_datadir/opencv/doc |
297 |
|
298 |
#-------------------------------------------------------------------------------- |
299 |
|
300 |
%package samples |
301 |
Summary: OpenCV sample code |
302 |
Group: Books/Computer books |
303 |
|
304 |
%description samples |
305 |
OpenCV sample code. |
306 |
|
307 |
%files samples |
308 |
%defattr(-,root,root,-) |
309 |
%{_bindir}/opencv_createsamples |
310 |
%{_bindir}/opencv_haartraining |
311 |
%{_bindir}/opencv_performance |
312 |
%{_bindir}/opencv_traincascade |
313 |
%dir %_datadir/opencv |
314 |
%_datadir/opencv/samples |
315 |
%_datadir/opencv/haarcascades |
316 |
%_datadir/opencv/lbpcascades |
317 |
#-------------------------------------------------------------------------------- |
318 |
|
319 |
%prep |
320 |
%setup -q -n OpenCV-%{version} |
321 |
%patch0 -p0 -b .v4l2 |
322 |
%patch1 -p0 -b .libs |
323 |
%patch2 -p1 -b .internal |
324 |
%patch3 -p1 -b .numpy |
325 |
|
326 |
cp -p 3rdparty/include/cblas.h 3rdparty |
327 |
cp -p 3rdparty/include/clapack.h 3rdparty |
328 |
cp -p 3rdparty/include/f2c.h 3rdparty |
329 |
|
330 |
rm -rf 3rdparty/lapack |
331 |
rm -rf 3rdparty/zlib |
332 |
rm -rf 3rdparty/libjasper |
333 |
rm -rf 3rdparty/libpng |
334 |
rm -rf 3rdparty/libjpeg |
335 |
rm -rf 3rdparty/libtiff |
336 |
rm -rf 3rdparty/ilmimf |
337 |
rm -rf 3rdparty/include/* |
338 |
|
339 |
cp -p 3rdparty/cblas.h 3rdparty/include |
340 |
cp -p 3rdparty/clapack.h 3rdparty/include |
341 |
cp -p 3rdparty/f2c.h 3rdparty/include |
342 |
|
343 |
%build |
344 |
export PYTHONDONTWRITEBYTECODE= |
345 |
%cmake \ |
346 |
-DBUILD_EXAMPLES=BOOL:ON \ |
347 |
-DINSTALL_C_EXAMPLES=BOOL:ON \ |
348 |
-DINSTALL_PYTHON_EXAMPLES=BOOL:ON \ |
349 |
-DINSTALL_OCTAVE_EXAMPLES=BOOL:ON \ |
350 |
-DWITH_FFMPEG=BOOL:ON |
351 |
%make |
352 |
|
353 |
%install |
354 |
%__rm -rf %{buildroot} |
355 |
export PYTHONDONTWRITEBYTECODE= |
356 |
%makeinstall_std -C build |
357 |
|
358 |
# Since libraries are installed in /usr/lib even when CMAKE_INSTALL_LIBDIR is set, |
359 |
# the following workaround is needed: |
360 |
%ifarch x86_64 |
361 |
mv %{buildroot}/usr/lib/ %{buildroot}%{_libdir} |
362 |
%endif |
363 |
|
364 |
# Remove GPU library because it requires CUDA: |
365 |
%__rm -rf %{buildroot}%{_libdir}/libopencv_gpu* |
366 |
|
367 |
%check |
368 |
pushd build |
369 |
# fwang: to be fixed by upstream: |
370 |
# Some correctness tests occasionally fail; in 99% of cases those |
371 |
# are known problems in the tests. |
372 |
# LD_LIBRARY_PATH=%{buildroot}%{_libdir}:`pwd`/lib:%{_libdir} ctest -V |
373 |
popd |
374 |
|
375 |
%clean |
376 |
%__rm -rf %{buildroot} |