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 java # Java binding
19 %bcond_without ffmpeg # FFMpeg support in highgui
20 %bcond_without gstreamer # GStreamer support in highgui
21 %bcond_with openni # OpenNI (Natural Interaction) support in highgui
22 %bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
23 %bcond_with qt # Qt backend instead of GTK+ in highgui
24 %bcond_with unicap # Unicap support in highgui (GPL)
25 %bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
26 %bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary)
27 %bcond_with xine # XINE support in highgui (GPL)
29 %ifarch pentium3 pentium4 %{x8664}
32 %ifarch pentium4 %{x8664}
35 Summary: A library of programming functions mainly aimed at real time computer vision
36 Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
41 %if %{with unicap} || %{with xine}
42 License: GPL (enforced by used libraries), BSD (opencv itself)
47 Source0: http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz
48 # Source0-md5: 8eac87462c7bec8b89021b723207c623
49 Patch0: %{name}-cflags.patch
50 Patch1: %{name}-link.patch
51 Patch2: %{name}-unicap-c++.patch
52 Patch3: %{name}-c.patch
53 Patch4: %{name}-gcc.patch
54 Patch5: %{name}-ximea.patch
55 Patch6: %{name}-ocl-fft.patch
56 Patch7: java-ant-sourcelevel.patch
57 URL: http://opencv.willowgarage.com/
58 %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
59 %{?with_opencl:BuildRequires: OpenCL-devel}
60 BuildRequires: OpenEXR-devel
61 %{?with_opengl:BuildRequires: OpenGL-devel}
62 %{?with_opengl:BuildRequires: OpenGL-GLU-devel}
63 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
64 %{?with_openni:BuildRequires: OpenNI-devel}
65 %{?with_ximea:BuildRequires: XIMEA-devel}
66 %{?with_java:BuildRequires: ant}
67 %{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel}
68 %{?with_opencl_amdfft:BuildRequires: clAmdFft-devel}
69 BuildRequires: cmake >= 2.8
70 BuildRequires: doxygen
71 BuildRequires: eigen3 >= 3
72 %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7}
74 BuildRequires: gstreamer-devel >= 0.10
75 BuildRequires: gstreamer-plugins-base-devel >= 0.10
77 BuildRequires: jasper-devel
78 %{?with_java:BuildRequires: jdk}
79 BuildRequires: libdc1394-devel
80 BuildRequires: libjpeg-devel
81 BuildRequires: libpng-devel
82 BuildRequires: libraw1394-devel
83 BuildRequires: libstdc++-devel
84 BuildRequires: libtiff-devel
85 BuildRequires: libtool
87 BuildRequires: libucil-devel
88 BuildRequires: libunicap-devel
90 BuildRequires: libv4l-devel
91 BuildRequires: pkgconfig
93 BuildRequires: python-devel
94 BuildRequires: python-numpy-devel
95 BuildRequires: rpm-pythonprov
96 BuildRequires: rpmbuild(macros) >= 1.606
97 BuildRequires: sed >= 4.0
98 BuildRequires: swig-python
99 %{?with_tbb:BuildRequires: tbb-devel}
100 %{?with_xine:BuildRequires: xine-lib-devel}
101 BuildRequires: zlib-devel
103 BuildRequires: QtCore-devel >= 4
104 BuildRequires: QtGui-devel >= 4
105 %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4}
106 BuildRequires: qt4-qmake >= 4
108 BuildRequires: gtk+2-devel >= 2.0
109 %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0}
111 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
113 # build broken, can't find g++
114 %undefine with_ccache
117 OpenCV (Open Source Computer Vision) is a library of programming
118 functions mainly aimed at real time computer vision.
120 Example applications of the OpenCV library are:
121 - Human-Computer Interaction (HCI)
122 - Object Identification, Segmentation and Recognition
124 - Gesture Recognition
126 - Ego Motion, Motion Understanding
127 - Structure From Motion (SFM)
128 - Stereo and Multi-Camera Calibration and Depth Computation
131 %description -l pl.UTF-8
132 OpenCV (Open Source Computer Vision) to biblioteka funkcji
133 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
135 Przykładowe zastosowania biblioteki OpenCV to
136 - interakcje człowiek-komputer (HCI)
137 - identyfikacja, segmentacja i rozpoznawanie obiektów
138 - rozpoznawanie twarzy
139 - rozpoznawanie gestów
142 - SFM (Structure From Motion)
143 - kalibracja dwu- i wielokamerowa, obliczanie głębi
147 Summary: Header files for OpenCV library
148 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
149 Group: Development/Libraries
150 Requires: %{name} = %{epoch}:%{version}-%{release}
151 Obsoletes: opencv-static
154 Header files for OpenCV library.
156 %description devel -l pl.UTF-8
157 Pliki nagłówkowe biblioteki OpenCV.
159 %package -n java-opencv
160 Summary: OpenCV Java bindings
161 Summary(pl.UTF-8): Wiązania Javy do OpenCV
162 Group: Libraries/Java
163 Requires: %{name} = %{epoch}:%{version}-%{release}
166 %description -n java-opencv
167 OpenCV Java bindings.
169 %description -n java-opencv -l pl.UTF-8
170 Wiązania Javy do OpenCV.
172 %package -n python-opencv
173 Summary: OpenCV Python bindings
174 Summary(pl.UTF-8): Wiązania Pythona do OpenCV
175 Group: Libraries/Python
176 Requires: %{name} = %{epoch}:%{version}-%{release}
177 %pyrequires_eq python-libs
179 %description -n python-opencv
180 OpenCV Python bindings.
182 %description -n python-opencv -l pl.UTF-8
183 Wiązania Pythona do OpenCV.
188 %undos CMakeLists.txt
189 %undos modules/gpu/CMakeLists.txt
204 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
205 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
206 -DBUILD_NEW_PYTHON_SUPPORT=ON \
208 %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
209 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
210 %{?with_opencl:-DWITH_OPENCL=ON} \
211 %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
212 %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
213 %{?with_opengl:-DWITH_OPENGL=ON} \
214 %{?with_openni:-DWITH_OPENNI=ON} \
215 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
216 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
217 %{?with_tbb:-DWITH_TBB=ON} \
218 %{?with_unicap:-DWITH_UNICAP=ON} \
219 %{!?with_v4l:-DWITH_V4L=OFF} \
220 %{?with_ximea:-DWITH_XIMEA=ON} \
221 %{?with_xine:-DWITH_XINE=ON}
226 rm -rf $RPM_BUILD_ROOT
227 %{__make} -C build install \
228 DESTDIR=$RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
231 cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
233 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
234 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
238 # move to proper directories, create symlink
239 install -d $RPM_BUILD_ROOT%{_javadir}
240 %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
241 %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
242 rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
243 ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
247 rm -rf $RPM_BUILD_ROOT
249 %post -p /sbin/ldconfig
250 %postun -p /sbin/ldconfig
252 %post -n java-opencv -p /sbin/ldconfig
253 %postun -n java-opencv -p /sbin/ldconfig
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_bindir}/opencv_*
258 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
259 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
260 %dir %{_datadir}/OpenCV
261 %doc %{_datadir}/OpenCV/doc
262 %{_datadir}/OpenCV/haarcascades
263 %{_datadir}/OpenCV/lbpcascades
266 %defattr(644,root,root,755)
267 %attr(755,root,root) %{_libdir}/libopencv_*.so
269 %exclude %{_libdir}/libopencv_java245.so
271 %{_includedir}/opencv
272 %{_includedir}/opencv2
273 %{_datadir}/OpenCV/OpenCVConfig*.cmake
274 %{_pkgconfigdir}/opencv.pc
277 %files -n java-opencv
278 %defattr(644,root,root,755)
279 %attr(755,root,root) %{_libdir}/libopencv_java245.so
280 %{_javadir}/opencv-245.jar
281 %{_javadir}/opencv.jar
284 %files -n python-opencv
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{py_sitedir}/cv2.so
287 %{py_sitedir}/cv.py[co]