# TODO:
+# - contrib subpackage(s)
+# - contrib BRs:
+# opencv_contrib-3.1.0/modules/cnn_3dobj/CMakeLists.txt:find_package(Caffe)
+# opencv_contrib-3.1.0/modules/cnn_3dobj/CMakeLists.txt:find_package(Protobuf)
+# opencv_contrib-3.1.0/modules/cnn_3dobj/CMakeLists.txt:find_package(Glog)
+# opencv_contrib-3.1.0/modules/hdf/CMakeLists.txt:find_package(HDF5)
+# opencv_contrib-3.1.0/modules/sfm/CMakeLists.txt:find_package(Ceres QUIET)
+# opencv_contrib-3.1.0/modules/text/CMakeLists.txt:find_package(Tesseract)
+#
# - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
# - CUDA, CUFFT, CUBLAS, NVCUVID support (on bcond)
# - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
Name: opencv
Version: 3.1.0
-Release: 2
+Release: 9
Epoch: 1
%if %{with unicap} || %{with xine}
License: GPL (enforced by used libraries), BSD (opencv itself)
Source1: https://github.com/Itseez/opencv_contrib/archive/%{version}/%{name}_contrib-%{version}.tar.gz
# Source1-md5: a822839ad3ab79ff837c16785ea9dd10
Patch0: %{name}-cflags.patch
-Patch5: %{name}-ximea.patch
-Patch7: java-ant-sourcelevel.patch
-Patch10: cmake-install-path.patch
+Patch1: %{name}-ximea.patch
+Patch2: java-ant-sourcelevel.patch
+Patch3: cmake-install-path.patch
+Patch4: vtk7.patch
+Patch5: no-redefinition.patch
URL: http://www.opencv.org/
%{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
%{?with_opencl:BuildRequires: OpenCL-devel}
BuildRequires: eigen3 >= 3
%{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7}
%{?with_openmp:BuildRequires: gcc-c++ >= 6:4.2}
+BuildRequires: gflags-devel
BuildRequires: gl2ps-devel
+BuildRequires: glog-devel
%if %{with gstreamer}
BuildRequires: gstreamer-devel >= 1.0
BuildRequires: gstreamer-plugins-base-devel >= 1.0
BuildRequires: python >= 2.0
BuildRequires: python-devel >= 2.0
BuildRequires: python-numpy-devel
+BuildRequires: python3 >= 1:3.2
+BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-numpy-devel
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.606
BuildRequires: sed >= 4.0
Wiązania Javy do OpenCV.
%package -n python-opencv
-Summary: OpenCV Python bindings
-Summary(pl.UTF-8): Wiązania Pythona do OpenCV
+Summary: OpenCV Python 2 bindings
+Summary(pl.UTF-8): Wiązania Pythona 2 do OpenCV
Group: Libraries/Python
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: python-libs
%description -n python-opencv
-OpenCV Python bindings.
+OpenCV Python 2 bindings.
%description -n python-opencv -l pl.UTF-8
-Wiązania Pythona do OpenCV.
+Wiązania Pythona 2 do OpenCV.
+
+%package -n python3-opencv
+Summary: OpenCV Python 3 bindings
+Summary(pl.UTF-8): Wiązania Pythona 3 do OpenCV
+Group: Libraries/Python
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: python3-libs
+
+%description -n python3-opencv
+OpenCV Python 3 bindings.
+
+%description -n python3-opencv -l pl.UTF-8
+Wiązania Pythona 3 do OpenCV.
%prep
%setup -q -a1
%undos CMakeLists.txt
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%patch5 -p1
-%patch7 -p1
-%patch10 -p1
%build
install -d build
%cmake .. \
$ccache \
+ -DENABLE_PRECOMPILED_HEADERS=OFF \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \
-DENABLE_AVX=%{?with_avx:ON}%{!?with_avx:OFF} \
-DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
%files -n python-opencv
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/cv2.so
-#%{py_sitedir}/cv.py[co]
+
+%files -n python3-opencv
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/cv2.cpython-*.so