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