3 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
4 # - CUDA support (on bcond)
5 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
9 %bcond_with tbb # Threading Building Blocks support (everywhere)
10 %bcond_with sse # use SSE instructions
11 %bcond_with sse2 # use SSE2 instructions
12 %bcond_without opencl # OpenCL support
13 %bcond_with opencl_amdblas # AMD OpenCL BLAS routines
14 %bcond_with opencl_amdfft # AMD OpenCL FFT routines
15 %bcond_without opengl # OpenGL support
17 %bcond_without ffmpeg # FFMpeg support in highgui
18 %bcond_without gstreamer # GStreamer support in highgui
19 %bcond_with openni # OpenNI (Natural Interaction) support in highgui
20 %bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
21 %bcond_with qt # Qt backend instead of GTK+ in highgui
22 %bcond_with unicap # Unicap support in highgui (GPL)
23 %bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
24 %bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary)
25 %bcond_with xine # XINE support in highgui (GPL)
27 %ifarch pentium3 pentium4 %{x8664}
30 %ifarch pentium4 %{x8664}
33 Summary: A library of programming functions mainly aimed at real time computer vision
34 Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
39 %if %{with unicap} || %{with xine}
40 License: GPL (enforced by used libraries), BSD (opencv itself)
45 Source0: http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz
46 # Source0-md5: 8eac87462c7bec8b89021b723207c623
47 Patch0: %{name}-cflags.patch
48 Patch1: %{name}-link.patch
49 Patch2: %{name}-unicap-c++.patch
50 Patch3: %{name}-c.patch
51 Patch4: %{name}-gcc.patch
52 Patch5: %{name}-ximea.patch
53 Patch6: %{name}-ocl-fft.patch
54 Patch7: %{name}-ocl-blas.patch
55 URL: http://opencv.willowgarage.com/
56 %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
57 %{?with_opencl:BuildRequires: OpenCL-devel}
58 BuildRequires: OpenEXR-devel
59 %{?with_opengl:BuildRequires: OpenGL-devel}
60 %{?with_opengl:BuildRequires: OpenGL-GLU-devel}
61 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
62 %{?with_openni:BuildRequires: OpenNI-devel}
63 %{?with_ximea:BuildRequires: XIMEA-devel}
64 %{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel}
65 %{?with_opencl_amdfft:BuildRequires: clAmdFft-devel}
66 BuildRequires: cmake >= 2.4
67 BuildRequires: doxygen
68 BuildRequires: eigen3 >= 3
69 %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7}
71 BuildRequires: gstreamer-devel >= 0.10
72 BuildRequires: gstreamer-plugins-base-devel >= 0.10
74 BuildRequires: jasper-devel
75 BuildRequires: libdc1394-devel
76 BuildRequires: libjpeg-devel
77 BuildRequires: libpng-devel
78 BuildRequires: libraw1394-devel
79 BuildRequires: libstdc++-devel
80 BuildRequires: libtiff-devel
81 BuildRequires: libtool
83 BuildRequires: libucil-devel
84 BuildRequires: libunicap-devel
86 BuildRequires: libv4l-devel
87 BuildRequires: pkgconfig
88 BuildRequires: python-devel
89 BuildRequires: python-numpy-devel
90 BuildRequires: rpm-pythonprov
91 BuildRequires: rpmbuild(macros) >= 1.606
92 BuildRequires: sed >= 4.0
93 BuildRequires: swig-python
94 %{?with_tbb:BuildRequires: tbb-devel}
95 %{?with_xine:BuildRequires: xine-lib-devel}
96 BuildRequires: zlib-devel
98 BuildRequires: QtCore-devel >= 4
99 BuildRequires: QtGui-devel >= 4
100 %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4}
101 BuildRequires: qt4-qmake >= 4
103 BuildRequires: gtk+2-devel >= 2.0
104 %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0}
106 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
109 OpenCV (Open Source Computer Vision) is a library of programming
110 functions mainly aimed at real time computer vision.
112 Example applications of the OpenCV library are:
113 - Human-Computer Interaction (HCI)
114 - Object Identification, Segmentation and Recognition
116 - Gesture Recognition
118 - Ego Motion, Motion Understanding
119 - Structure From Motion (SFM)
120 - Stereo and Multi-Camera Calibration and Depth Computation
123 %description -l pl.UTF-8
124 OpenCV (Open Source Computer Vision) to biblioteka funkcji
125 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
127 Przykładowe zastosowania biblioteki OpenCV to
128 - interakcje człowiek-komputer (HCI)
129 - identyfikacja, segmentacja i rozpoznawanie obiektów
130 - rozpoznawanie twarzy
131 - rozpoznawanie gestów
134 - SFM (Structure From Motion)
135 - kalibracja dwu- i wielokamerowa, obliczanie głębi
139 Summary: Header files for OpenCV library
140 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
141 Group: Development/Libraries
142 Requires: %{name} = %{epoch}:%{version}-%{release}
143 Obsoletes: opencv-static
146 Header files for OpenCV library.
148 %description devel -l pl.UTF-8
149 Pliki nagłówkowe biblioteki OpenCV.
151 %package -n python-opencv
152 Summary: OpenCV Python bindings
153 Summary(pl.UTF-8): Wiązania Pythona do OpenCV
154 Group: Libraries/Python
155 Requires: %{name} = %{epoch}:%{version}-%{release}
156 %pyrequires_eq python-libs
158 %description -n python-opencv
159 OpenCV Python bindings.
161 %description -n python-opencv -l pl.UTF-8
162 Wiązania Pythona do OpenCV.
167 %undos CMakeLists.txt
168 %undos modules/gpu/CMakeLists.txt
183 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
184 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
185 -DBUILD_NEW_PYTHON_SUPPORT=ON \
187 %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
188 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
189 %{?with_opencl:-DWITH_OPENCL=ON} \
190 %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
191 %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
192 %{?with_opengl:-DWITH_OPENGL=ON} \
193 %{?with_openni:-DWITH_OPENNI=ON} \
194 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
195 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
196 %{?with_tbb:-DWITH_TBB=ON} \
197 %{?with_unicap:-DWITH_UNICAP=ON} \
198 %{!?with_v4l:-DWITH_V4L=OFF} \
199 %{?with_ximea:-DWITH_XIMEA=ON} \
200 %{?with_xine:-DWITH_XINE=ON}
205 rm -rf $RPM_BUILD_ROOT
207 %{__make} -C build install \
208 DESTDIR=$RPM_BUILD_ROOT
210 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
211 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
213 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
214 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
218 rm -rf $RPM_BUILD_ROOT
220 %post -p /sbin/ldconfig
221 %postun -p /sbin/ldconfig
224 %defattr(644,root,root,755)
225 %attr(755,root,root) %{_bindir}/opencv_*
226 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
227 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
228 %dir %{_datadir}/OpenCV
229 %doc %{_datadir}/OpenCV/doc
230 %{_datadir}/OpenCV/haarcascades
231 %{_datadir}/OpenCV/lbpcascades
234 %defattr(644,root,root,755)
235 %attr(755,root,root) %{_libdir}/libopencv_*.so
236 %{_includedir}/opencv
237 %{_includedir}/opencv2
238 %{_datadir}/OpenCV/OpenCVConfig*.cmake
239 %{_pkgconfigdir}/opencv.pc
241 %files -n python-opencv
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{py_sitedir}/cv2.so
244 %{py_sitedir}/cv.py[co]