-# TODO: CUDA support (on bcond)
+#
+# TODO:
+# - CUDA support (on bcond)
#
# Conditional build:
-%bcond_without gstreamer # GStreamer support
-%bcond_with pvapi # PvAPI (AVT GigE cameras) support
-%bcond_with qt # Qt backend instead of GTK+
-%bcond_with tbb # Threading Building Blocks support
-%bcond_with unicap # Unicap support (GPL)
-%bcond_with v4l # Video4Linux (even V4L2 support currently relies on V4L1 API)
-%bcond_with xine # XINE support (GPL)
+# - general options:
+%bcond_with tbb # Threading Building Blocks support (everywhere)
+%bcond_with sse # use SSE instructions
+%bcond_with sse2 # use SSE2 instructions
+# - highgui options:
+%bcond_without gstreamer # GStreamer support in highgui
+%bcond_with openni # OpenNI (Natural Interaction) support in highgui
+%bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
+%bcond_with qt # Qt backend instead of GTK+ in highgui
+%bcond_with unicap # Unicap support in highgui (GPL)
+%bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
+%bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary)
+%bcond_with xine # XINE support in highgui (GPL)
#
+%ifarch pentium3 pentium4 %{x8664}
+%define with_sse 1
+%endif
+%ifarch pentium4 %{x8664}
+%define with_sse2 1
+%endif
Summary: A library of programming functions mainly aimed at real time computer vision
Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
Name: opencv
-Version: 2.2.0
-Release: 9
+Version: 2.3.1
+Release: 7
Epoch: 1
%if %{with unicap} || %{with xine}
License: GPL (enforced by used libraries), BSD (opencv itself)
License: BSD
%endif
Group: Libraries
-Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2
-# Source0-md5: 122c9ac793a46854ef2819fedbbd6b1b
-Patch0: %{name}-multilib.patch
-Patch1: %{name}-cflags.patch
-Patch2: %{name}-link.patch
-Patch3: %{name}-unicap-c++.patch
-Patch4: %{name}-c.patch
-Patch5: %{name}-gcc.patch
-Patch6: %{name}-ffmpeg-0.8.patch
+Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}a.tar.bz2
+# Source0-md5: 82e4b6bfa349777233eea09b075e931e
+Patch0: %{name}-cflags.patch
+Patch1: %{name}-link.patch
+Patch2: %{name}-unicap-c++.patch
+Patch3: %{name}-c.patch
+Patch4: %{name}-gcc.patch
+Patch5: %{name}-multilib.patch
+Patch6: %{name}-ximea-linux.patch
URL: http://opencv.willowgarage.com/
%{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
BuildRequires: OpenEXR-devel
+# as of OpenCV 2.3.1 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
+%{?with_openni:BuildRequires: OpenNI-devel}
+%{?with_ximea:BuildRequires: XIMEA-devel}
BuildRequires: cmake >= 2.4
BuildRequires: doxygen
BuildRequires: eigen >= 2
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.577
+BuildRequires: rpmbuild(macros) >= 1.606
BuildRequires: sed >= 4.0
BuildRequires: swig-python
%{?with_tbb:BuildRequires: tbb-devel}
-BuildRequires: zlib-devel
%{?with_xine:BuildRequires: xine-lib-devel}
+BuildRequires: zlib-devel
%if %{with qt}
BuildRequires: OpenGL-devel
BuildRequires: QtCore-devel >= 4
install -d build
cd build
%cmake .. \
- -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
- -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
-%ifarch pentium4 %{x8664}
- -DENABLE_SSE=ON \
- -DENABLE_SSE2=ON \
-%else
- -DENABLE_SSE=OFF \
- -DENABLE_SSE2=OFF \
-%endif
+ -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
+ -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DUSE_O3=OFF \
%{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
+ %{?with_openni:-DWITH_OPENNI=ON} \
%{!?with_pvapi:-DWITH_PVAPI=OFF} \
%{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
%{?with_tbb:-DWITH_TBB=ON} \
%{?with_unicap:-DWITH_UNICAP=ON} \
%{!?with_v4l:-DWITH_V4L=OFF} \
+ %{?with_ximea:-DWITH_XIMEA=ON} \
%{?with_xine:-DWITH_XINE=ON}
%{__make}
install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
-%if "%{_lib}" == "lib64"
-# upstream has no lib64 support
-mv $RPM_BUILD_ROOT%{_prefix}/lib/lib*.so* $RPM_BUILD_ROOT%{_libdir}
-%endif
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/opencv_*
%attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.2
-%dir %{_datadir}/opencv
-%doc %{_datadir}/opencv/doc
-%{_datadir}/opencv/haarcascades
-%{_datadir}/opencv/lbpcascades
+%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.3
+%dir %{_datadir}/OpenCV
+%doc %{_datadir}/OpenCV/doc
+%{_datadir}/OpenCV/haarcascades
+%{_datadir}/OpenCV/lbpcascades
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libopencv_*.so
%{_includedir}/opencv
%{_includedir}/opencv2
-%{_datadir}/opencv/OpenCVConfig.cmake
+%{_datadir}/OpenCV/OpenCVConfig*.cmake
%{_pkgconfigdir}/opencv.pc
%files -n python-opencv
%defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/cv.so
+%attr(755,root,root) %{py_sitedir}/cv2.so
+%{py_sitedir}/cv.py[co]