3 # - CUDA support (on bcond)
7 %bcond_with tbb # Threading Building Blocks support (everywhere)
8 %bcond_with sse # use SSE instructions
9 %bcond_with sse2 # use SSE2 instructions
11 %bcond_without gstreamer # GStreamer support in highgui
12 %bcond_with openni # OpenNI (Natural Interaction) support in highgui
13 %bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
14 %bcond_with qt # Qt backend instead of GTK+ in highgui
15 %bcond_with unicap # Unicap support in highgui (GPL)
16 %bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
17 %bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary)
18 %bcond_with xine # XINE support in highgui (GPL)
20 %ifarch pentium3 pentium4 %{x8664}
23 %ifarch pentium4 %{x8664}
26 Summary: A library of programming functions mainly aimed at real time computer vision
27 Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
32 %if %{with unicap} || %{with xine}
33 License: GPL (enforced by used libraries), BSD (opencv itself)
38 Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2
39 # Source0-md5: 059ef86fc1724d69b75832a0d2929ff5
40 Patch0: %{name}-cflags.patch
41 Patch1: %{name}-link.patch
42 Patch2: %{name}-unicap-c++.patch
43 Patch3: %{name}-c.patch
44 Patch4: %{name}-gcc.patch
45 URL: http://opencv.willowgarage.com/
46 %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
47 BuildRequires: OpenEXR-devel
48 # as of OpenCV 2.3.1 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
49 %{?with_openni:BuildRequires: OpenNI-devel}
50 %{?with_ximea:BuildRequires: XIMEA-devel}
51 BuildRequires: cmake >= 2.4
52 BuildRequires: doxygen
53 BuildRequires: eigen >= 2
54 BuildRequires: ffmpeg-devel >= 0.7
56 BuildRequires: gstreamer-devel >= 0.10
57 BuildRequires: gstreamer-plugins-base-devel >= 0.10
59 BuildRequires: jasper-devel
60 BuildRequires: libdc1394-devel
61 BuildRequires: libjpeg-devel
62 BuildRequires: libpng-devel
63 BuildRequires: libraw1394-devel
64 BuildRequires: libstdc++-devel
65 BuildRequires: libtiff-devel
66 BuildRequires: libtool
68 BuildRequires: libucil-devel
69 BuildRequires: libunicap-devel
71 BuildRequires: libv4l-devel
72 BuildRequires: pkgconfig
73 BuildRequires: python-devel
74 BuildRequires: python-numpy-devel
75 BuildRequires: rpm-pythonprov
76 BuildRequires: rpmbuild(macros) >= 1.606
77 BuildRequires: sed >= 4.0
78 BuildRequires: swig-python
79 %{?with_tbb:BuildRequires: tbb-devel}
80 %{?with_xine:BuildRequires: xine-lib-devel}
81 BuildRequires: zlib-devel
83 BuildRequires: OpenGL-devel
84 BuildRequires: QtCore-devel >= 4
85 BuildRequires: QtGui-devel >= 4
86 BuildRequires: QtOpenGL-devel >= 4
87 BuildRequires: qt4-qmake >= 4
89 BuildRequires: gtk+2-devel >= 2.0
91 # ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
92 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95 OpenCV (Open Source Computer Vision) is a library of programming
96 functions mainly aimed at real time computer vision.
98 Example applications of the OpenCV library are:
99 - Human-Computer Interaction (HCI)
100 - Object Identification, Segmentation and Recognition
102 - Gesture Recognition
104 - Ego Motion, Motion Understanding
105 - Structure From Motion (SFM)
106 - Stereo and Multi-Camera Calibration and Depth Computation
109 %description -l pl.UTF-8
110 OpenCV (Open Source Computer Vision) to biblioteka funkcji
111 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
113 Przykładowe zastosowania biblioteki OpenCV to
114 - interakcje człowiek-komputer (HCI)
115 - identyfikacja, segmentacja i rozpoznawanie obiektów
116 - rozpoznawanie twarzy
117 - rozpoznawanie gestów
120 - SFM (Structure From Motion)
121 - kalibracja dwu- i wielokamerowa, obliczanie głębi
125 Summary: Header files for OpenCV library
126 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
127 Group: Development/Libraries
128 Requires: %{name} = %{epoch}:%{version}-%{release}
129 Obsoletes: opencv-static
132 Header files for OpenCV library.
134 %description devel -l pl.UTF-8
135 Pliki nagłówkowe biblioteki OpenCV.
137 %package -n python-opencv
138 Summary: OpenCV Python bindings
139 Summary(pl.UTF-8): Wiązania Pythona do OpenCV
140 Group: Libraries/Python
141 Requires: %{name} = %{epoch}:%{version}-%{release}
142 %pyrequires_eq python-libs
144 %description -n python-opencv
145 OpenCV Python bindings.
147 %description -n python-opencv -l pl.UTF-8
148 Wiązania Pythona do OpenCV.
151 %setup -q -n OpenCV-%{version}
153 %undos CMakeLists.txt
154 %undos modules/gpu/CMakeLists.txt
166 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
167 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
168 -DBUILD_NEW_PYTHON_SUPPORT=ON \
170 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
171 %{?with_openni:-DWITH_OPENNI=ON} \
172 %{!?with_pvapi:-DWITH_PVAPI=OFF} \
173 %{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
174 %{?with_tbb:-DWITH_TBB=ON} \
175 %{?with_unicap:-DWITH_UNICAP=ON} \
176 %{!?with_v4l:-DWITH_V4L=OFF} \
177 %{?with_ximea:-DWITH_XIMEA=ON} \
178 %{?with_xine:-DWITH_XINE=ON}
183 rm -rf $RPM_BUILD_ROOT
185 %{__make} -C build install \
186 DESTDIR=$RPM_BUILD_ROOT
188 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
189 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
191 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
192 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
196 rm -rf $RPM_BUILD_ROOT
198 %post -p /sbin/ldconfig
199 %postun -p /sbin/ldconfig
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_bindir}/opencv_*
204 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
205 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
206 %dir %{_datadir}/OpenCV
207 %doc %{_datadir}/OpenCV/doc
208 %{_datadir}/OpenCV/haarcascades
209 %{_datadir}/OpenCV/lbpcascades
212 %defattr(644,root,root,755)
213 %attr(755,root,root) %{_libdir}/libopencv_*.so
214 %{_includedir}/opencv
215 %{_includedir}/opencv2
216 %{_datadir}/OpenCV/OpenCVConfig*.cmake
217 %{_pkgconfigdir}/opencv.pc
219 %files -n python-opencv
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{py_sitedir}/cv2.so
222 %{py_sitedir}/cv.py[co]