#
+# TODO: - CUDA support (on bcond)
+# - consider name change to OpenCV
+#
# Conditional build:
-%bcond_with gstreamer # GStreamer support
+%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)
#
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: 6
+Version: 2.3.1
+Release: 1
Epoch: 1
+%if %{with unicap} || %{with xine}
+License: GPL (enforced by used libraries), BSD (opencv itself)
+%else
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
+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
URL: http://opencv.willowgarage.com/
+%{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
BuildRequires: OpenEXR-devel
BuildRequires: cmake >= 2.4
BuildRequires: doxygen
-BuildRequires: ffmpeg-devel
+BuildRequires: eigen >= 2
+BuildRequires: ffmpeg-devel >= 0.7
%if %{with gstreamer}
BuildRequires: gstreamer-devel >= 0.10
BuildRequires: gstreamer-plugins-base-devel >= 0.10
%endif
BuildRequires: jasper-devel
-BuildRequires: gtk+2-devel
BuildRequires: libdc1394-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: libtiff-devel
BuildRequires: libtool
+%if %{with unicap}
+BuildRequires: libucil-devel
+BuildRequires: libunicap-devel
+%endif
BuildRequires: libv4l-devel
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.577
+BuildRequires: rpmbuild(macros) >= 1.600
BuildRequires: sed >= 4.0
BuildRequires: swig-python
-BuildRequires: zlib-devel
+%{?with_tbb:BuildRequires: tbb-devel}
%{?with_xine:BuildRequires: xine-lib-devel}
-# TODO:
-# - unicap (libunicap, libucil)
-# - gstreamer
-# - pvapi (PvApi.h)
-# - Qt (bcond replacing GTK+?)
-# - tbb (tbb.pc)
-# - cuda (on bcond)
-# - eigen2/eigen3 (Eigen/Core headers)
-# - ipp (libippi)
+BuildRequires: zlib-devel
+%if %{with qt}
+BuildRequires: OpenGL-devel
+BuildRequires: QtCore-devel >= 4
+BuildRequires: QtGui-devel >= 4
+BuildRequires: QtOpenGL-devel >= 4
+BuildRequires: qt4-qmake >= 4
+%else
+BuildRequires: gtk+2-devel >= 2.0
+%endif
+# ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define skip_post_check_so libhighgui.so.%{version}
-
%description
OpenCV (Open Source Computer Vision) is a library of programming
functions mainly aimed at real time computer vision.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
install -d build
%endif
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DUSE_O3=OFF \
- -DWITH_1394=ON \
- -DWITH_FFMPEG=ON \
- -DWITH_GSTREAMER=OFF \
- -DWITH_GTK=ON \
- -DWITH_V4L=ON \
-%if %{with xine}
- -DWITH_XINE=ON
-%endif
+ %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
+ %{!?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_xine:-DWITH_XINE=ON}
%{__make}
%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