3 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
4 # - finish AMD OpenCL routines support
5 # - CUDA support (on bcond)
6 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
10 %bcond_with tbb # Threading Building Blocks support (everywhere)
11 %bcond_with sse # use SSE instructions
12 %bcond_with sse2 # use SSE2 instructions
13 %bcond_without opencl # OpenCL support
14 %bcond_with opencl_amdblas # AMD OpenCL BLAS routines
15 %bcond_with opencl_amdfft # AMD OpenCL FFT routines
16 %bcond_without opengl # OpenGL support
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-%{version}.tar.bz2
46 # Source0-md5: c0a5af4ff9d0d540684c0bf00ef35dbe
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 URL: http://opencv.willowgarage.com/
54 %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
55 %{?with_opencl:BuildRequires: OpenCL-devel}
56 BuildRequires: OpenEXR-devel
57 %{?with_opengl:BuildRequires: OpenGL-devel}
58 %{?with_opengl:BuildRequires: OpenGL-GLU-devel}
59 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
60 %{?with_openni:BuildRequires: OpenNI-devel}
61 %{?with_ximea:BuildRequires: XIMEA-devel}
62 BuildRequires: cmake >= 2.4
63 BuildRequires: doxygen
64 BuildRequires: eigen3 >= 3
65 BuildRequires: ffmpeg-devel >= 0.7
67 BuildRequires: gstreamer-devel >= 0.10
68 BuildRequires: gstreamer-plugins-base-devel >= 0.10
70 BuildRequires: jasper-devel
71 BuildRequires: libdc1394-devel
72 BuildRequires: libjpeg-devel
73 BuildRequires: libpng-devel
74 BuildRequires: libraw1394-devel
75 BuildRequires: libstdc++-devel
76 BuildRequires: libtiff-devel
77 BuildRequires: libtool
79 BuildRequires: libucil-devel
80 BuildRequires: libunicap-devel
82 BuildRequires: libv4l-devel
83 BuildRequires: pkgconfig
84 BuildRequires: python-devel
85 BuildRequires: python-numpy-devel
86 BuildRequires: rpm-pythonprov
87 BuildRequires: rpmbuild(macros) >= 1.606
88 BuildRequires: sed >= 4.0
89 BuildRequires: swig-python
90 %{?with_tbb:BuildRequires: tbb-devel}
91 %{?with_xine:BuildRequires: xine-lib-devel}
92 BuildRequires: zlib-devel
94 BuildRequires: QtCore-devel >= 4
95 BuildRequires: QtGui-devel >= 4
96 %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4}
97 BuildRequires: qt4-qmake >= 4
99 BuildRequires: gtk+2-devel >= 2.0
100 %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0}
102 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
105 OpenCV (Open Source Computer Vision) is a library of programming
106 functions mainly aimed at real time computer vision.
108 Example applications of the OpenCV library are:
109 - Human-Computer Interaction (HCI)
110 - Object Identification, Segmentation and Recognition
112 - Gesture Recognition
114 - Ego Motion, Motion Understanding
115 - Structure From Motion (SFM)
116 - Stereo and Multi-Camera Calibration and Depth Computation
119 %description -l pl.UTF-8
120 OpenCV (Open Source Computer Vision) to biblioteka funkcji
121 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
123 Przykładowe zastosowania biblioteki OpenCV to
124 - interakcje człowiek-komputer (HCI)
125 - identyfikacja, segmentacja i rozpoznawanie obiektów
126 - rozpoznawanie twarzy
127 - rozpoznawanie gestów
130 - SFM (Structure From Motion)
131 - kalibracja dwu- i wielokamerowa, obliczanie głębi
135 Summary: Header files for OpenCV library
136 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
137 Group: Development/Libraries
138 Requires: %{name} = %{epoch}:%{version}-%{release}
139 Obsoletes: opencv-static
142 Header files for OpenCV library.
144 %description devel -l pl.UTF-8
145 Pliki nagłówkowe biblioteki OpenCV.
147 %package -n python-opencv
148 Summary: OpenCV Python bindings
149 Summary(pl.UTF-8): Wiązania Pythona do OpenCV
150 Group: Libraries/Python
151 Requires: %{name} = %{epoch}:%{version}-%{release}
152 %pyrequires_eq python-libs
154 %description -n python-opencv
155 OpenCV Python bindings.
157 %description -n python-opencv -l pl.UTF-8
158 Wiązania Pythona do OpenCV.
161 %setup -q -n OpenCV-%{version}
163 %undos CMakeLists.txt
164 %undos modules/gpu/CMakeLists.txt
177 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
178 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
179 -DBUILD_NEW_PYTHON_SUPPORT=ON \
181 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
182 %{?with_opencl:-DWITH_OPENCL=ON} \
183 %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
184 %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
185 %{?with_opengl:-DWITH_OPENGL=ON} \
186 %{?with_openni:-DWITH_OPENNI=ON} \
187 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
188 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
189 %{?with_tbb:-DWITH_TBB=ON} \
190 %{?with_unicap:-DWITH_UNICAP=ON} \
191 %{!?with_v4l:-DWITH_V4L=OFF} \
192 %{?with_ximea:-DWITH_XIMEA=ON} \
193 %{?with_xine:-DWITH_XINE=ON}
198 rm -rf $RPM_BUILD_ROOT
200 %{__make} -C build install \
201 DESTDIR=$RPM_BUILD_ROOT
203 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
204 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
206 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
207 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
211 rm -rf $RPM_BUILD_ROOT
213 %post -p /sbin/ldconfig
214 %postun -p /sbin/ldconfig
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_bindir}/opencv_*
219 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
220 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
221 %dir %{_datadir}/OpenCV
222 %doc %{_datadir}/OpenCV/doc
223 %{_datadir}/OpenCV/haarcascades
224 %{_datadir}/OpenCV/lbpcascades
227 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_libdir}/libopencv_*.so
229 %{_includedir}/opencv
230 %{_includedir}/opencv2
231 %{_datadir}/OpenCV/OpenCVConfig*.cmake
232 %{_pkgconfigdir}/opencv.pc
234 %files -n python-opencv
235 %defattr(644,root,root,755)
236 %attr(755,root,root) %{py_sitedir}/cv2.so
237 %{py_sitedir}/cv.py[co]