2010-03-08 18:16:50 +01:00
|
|
|
#
|
2011-01-14 15:36:03 +01:00
|
|
|
# spec file for package opencv
|
2010-03-08 18:16:50 +01:00
|
|
|
#
|
2017-06-12 15:13:03 +02:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-03-08 18:16:50 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define libname lib%{name}
|
2017-06-12 15:13:03 +02:00
|
|
|
%define soname 3_2
|
2017-07-11 08:24:11 +02:00
|
|
|
# disabled by default as many fail
|
|
|
|
%bcond_with tests
|
|
|
|
%bcond_without qt5
|
|
|
|
%bcond_without ffmpeg
|
2013-08-01 15:56:40 +02:00
|
|
|
Name: opencv
|
2017-06-12 15:13:03 +02:00
|
|
|
Version: 3.2.0
|
2012-01-04 07:25:38 +01:00
|
|
|
Release: 0
|
2011-07-07 14:28:27 +02:00
|
|
|
Summary: Collection of algorithms for computer vision
|
2012-01-04 07:25:38 +01:00
|
|
|
License: BSD-3-Clause
|
2011-10-18 14:24:16 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2013-08-01 15:56:40 +02:00
|
|
|
Url: http://opencv.org/
|
2015-12-16 17:41:36 +01:00
|
|
|
Source0: https://github.com/Itseez/opencv/archive/%{version}.tar.gz
|
2016-03-05 11:21:23 +01:00
|
|
|
# This is the FACE module from the opencv_contrib package. Packaged separately to prevent too much usntable modules
|
|
|
|
Source1: opencv_contrib_face-3.1.0.tar.bz2
|
2017-07-11 08:24:11 +02:00
|
|
|
# PATCH-FIX-UPSTREAM opencv-gles.patch -- Make sure PERSPECTIVE_CORRECTION_HINT is validated first
|
|
|
|
Patch1: opencv-gles.patch
|
2016-01-28 17:18:35 +01:00
|
|
|
# PATCH-FIX-OPENSUSE opencv-build-compare.patch -- avoid republish if some random external version number changes
|
|
|
|
Patch8: opencv-build-compare.patch
|
2017-06-12 15:13:03 +02:00
|
|
|
# PATCH-FIX-UPSTREAM opencv-gcc6-fix-pch-support-PR8345.patch -- fix PCH support on GCC 6.x
|
|
|
|
Patch10: opencv-gcc6-fix-pch-support-PR8345.patch
|
2017-07-25 11:35:34 +02:00
|
|
|
# PATCH-FIX-OPENSUSE 0001-Do-not-include-glx.h-when-using-GLES.patch -- Fix build error on 32bit ARM, due to incompatible pointer types
|
|
|
|
Patch11: 0001-Do-not-include-glx.h-when-using-GLES.patch
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: cmake
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: fdupes
|
2013-08-01 15:56:40 +02:00
|
|
|
BuildRequires: libeigen3-devel
|
2017-07-11 08:24:11 +02:00
|
|
|
BuildRequires: libjasper-devel
|
|
|
|
BuildRequires: libjpeg-devel
|
|
|
|
BuildRequires: openblas-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: python-numpy-devel
|
|
|
|
BuildRequires: python3-numpy-devel
|
|
|
|
BuildRequires: tbb-devel
|
|
|
|
BuildRequires: unzip
|
|
|
|
BuildRequires: pkgconfig(IlmBase)
|
|
|
|
BuildRequires: pkgconfig(OpenEXR)
|
|
|
|
BuildRequires: pkgconfig(glu)
|
|
|
|
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
|
|
|
|
BuildRequires: pkgconfig(libdc1394-2)
|
|
|
|
BuildRequires: pkgconfig(libgphoto2)
|
|
|
|
BuildRequires: pkgconfig(libpng)
|
|
|
|
BuildRequires: pkgconfig(libtiff-4)
|
|
|
|
BuildRequires: pkgconfig(libv4l2)
|
|
|
|
BuildRequires: pkgconfig(libv4lconvert)
|
|
|
|
BuildRequires: pkgconfig(python)
|
|
|
|
BuildRequires: pkgconfig(python3)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
|
|
|
Provides: opencv-qt5
|
|
|
|
Obsoletes: opencv-qt5
|
|
|
|
%if %{with qt5}
|
|
|
|
BuildRequires: pkgconfig(Qt5Concurrent) >= 5.2.0
|
|
|
|
BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0
|
|
|
|
BuildRequires: pkgconfig(Qt5OpenGL) >= 5.2.0
|
|
|
|
BuildRequires: pkgconfig(Qt5Test) >= 5.2.0
|
|
|
|
BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0
|
2013-08-01 15:56:40 +02:00
|
|
|
%else
|
2017-07-11 08:24:11 +02:00
|
|
|
BuildRequires: pkgconfig(QtCore)
|
|
|
|
BuildRequires: pkgconfig(QtGui)
|
|
|
|
BuildRequires: pkgconfig(QtOpenGL)
|
|
|
|
BuildRequires: pkgconfig(QtTest)
|
2013-08-01 15:56:40 +02:00
|
|
|
%endif
|
|
|
|
%if %{with ffmpeg}
|
2016-07-28 23:43:33 +02:00
|
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
|
|
BuildRequires: pkgconfig(libavformat)
|
|
|
|
BuildRequires: pkgconfig(libavutil)
|
|
|
|
BuildRequires: pkgconfig(libswscale)
|
2013-08-01 15:56:40 +02:00
|
|
|
%endif
|
2015-12-27 01:59:41 +01:00
|
|
|
%if 0%{?suse_version} != 1315 || 0%{?is_opensuse}
|
2013-08-01 15:56:40 +02:00
|
|
|
BuildRequires: python-sphinx
|
2015-12-27 01:59:41 +01:00
|
|
|
%endif
|
2010-12-14 10:27:03 +01:00
|
|
|
|
2010-03-08 18:16:50 +01:00
|
|
|
%description
|
|
|
|
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C
|
|
|
|
functions and a few C++ classes that implement some popular Image Processing and
|
|
|
|
Computer Vision algorithms.
|
|
|
|
|
|
|
|
%package -n %{libname}%{soname}
|
2017-07-11 08:24:11 +02:00
|
|
|
Summary: Libraries to use OpenCV computer vision
|
|
|
|
Group: System/Libraries
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%description -n %{libname}%{soname}
|
|
|
|
The Open Computer Vision Library is a collection of algorithms and sample code
|
|
|
|
for various computer vision problems. The library is compatible with IPL and
|
|
|
|
utilizes Intel Integrated Performance Primitives for better performance.
|
|
|
|
|
2010-04-25 18:45:15 +02:00
|
|
|
%package devel
|
2010-03-08 18:16:50 +01:00
|
|
|
Summary: Development files for using the OpenCV library
|
2017-06-12 15:13:03 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2010-03-08 18:16:50 +01:00
|
|
|
Requires: %{libname}%{soname} = %{version}
|
|
|
|
Requires: %{name} = %{version}
|
2014-03-13 20:43:49 +01:00
|
|
|
Requires: pkgconfig(gl)
|
2013-11-18 13:09:08 +01:00
|
|
|
Requires: pkgconfig(glu)
|
2014-03-13 20:43:49 +01:00
|
|
|
Requires: pkgconfig(ice)
|
|
|
|
Requires: pkgconfig(sm)
|
|
|
|
Requires: pkgconfig(x11)
|
|
|
|
Requires: pkgconfig(xext)
|
2017-07-11 08:24:11 +02:00
|
|
|
Provides: %{name}-qt5-devel
|
|
|
|
Obsoletes: %{name}-qt5-devel
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2010-04-25 18:45:15 +02:00
|
|
|
%description devel
|
2010-03-08 18:16:50 +01:00
|
|
|
This package contains the OpenCV C/C++ library and header files, as well as
|
|
|
|
documentation. It should be installed if you want to develop programs that will
|
|
|
|
use the OpenCV library.
|
|
|
|
|
2016-03-26 15:20:54 +01:00
|
|
|
%package -n python-%{name}
|
|
|
|
Summary: Python 2 bindings for apps which use OpenCV
|
2011-10-18 14:24:16 +02:00
|
|
|
Group: Development/Libraries/Python
|
2017-07-11 08:24:11 +02:00
|
|
|
Requires: python-base
|
|
|
|
Provides: python-%{name}-qt5
|
|
|
|
Obsoletes: python-%{name}-qt5
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2016-03-26 15:20:54 +01:00
|
|
|
%description -n python-%{name}
|
|
|
|
This package contains Python 2 bindings for the OpenCV library.
|
|
|
|
|
|
|
|
%package -n python3-%{name}
|
|
|
|
Summary: Python 3 bindings for apps which use OpenCV
|
|
|
|
Group: Development/Libraries/Python
|
2017-07-11 08:24:11 +02:00
|
|
|
Requires: python3-base
|
|
|
|
Provides: python3-%{name}-qt5
|
|
|
|
Obsoletes: python3-%{name}-qt5
|
2016-03-26 15:20:54 +01:00
|
|
|
|
|
|
|
%description -n python3-%{name}
|
|
|
|
This package contains Python 3 bindings for the OpenCV library.
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%package doc
|
2010-03-08 18:16:50 +01:00
|
|
|
Summary: Documentation and examples for OpenCV
|
2017-07-11 08:24:11 +02:00
|
|
|
Group: Documentation/Other
|
2011-10-18 14:24:16 +02:00
|
|
|
Recommends: python
|
2010-03-08 18:16:50 +01:00
|
|
|
# Since this package also contains examples that need -devel to be compiled
|
2017-07-11 08:24:11 +02:00
|
|
|
Suggests: %{name}-devel
|
|
|
|
Provides: %{name}-qt5-doc
|
|
|
|
Obsoletes: %{name}-qt5-doc
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%description doc
|
2010-03-08 18:16:50 +01:00
|
|
|
This package contains the documentation and examples for the OpenCV library.
|
|
|
|
|
|
|
|
%prep
|
2016-03-05 11:21:23 +01:00
|
|
|
%setup -q -a 1
|
2017-07-11 08:24:11 +02:00
|
|
|
%autopatch -p1
|
2011-07-07 14:28:27 +02:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
# Remove Windows specific files
|
2011-07-07 14:28:27 +02:00
|
|
|
rm -f doc/packaging.txt
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%build
|
2017-06-12 15:13:03 +02:00
|
|
|
# TODO for OCV 3.3: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
2017-07-11 08:24:11 +02:00
|
|
|
%cmake \
|
|
|
|
%if %{with tests}
|
|
|
|
-DBUILD_TESTS=ON \
|
|
|
|
%endif
|
2011-10-18 14:24:16 +02:00
|
|
|
-DINSTALL_C_EXAMPLES=ON \
|
|
|
|
-DINSTALL_PYTHON_EXAMPLES=ON \
|
2012-05-16 21:08:46 +02:00
|
|
|
-DENABLE_OMIT_FRAME_POINTER=OFF \
|
2011-08-18 09:52:40 +02:00
|
|
|
-DWITH_QT=ON \
|
2012-05-16 21:08:46 +02:00
|
|
|
-DWITH_OPENGL=ON \
|
2011-10-18 14:24:16 +02:00
|
|
|
-DWITH_UNICAP=ON \
|
|
|
|
-DWITH_XINE=ON \
|
2016-03-05 11:21:23 +01:00
|
|
|
-DWITH_IPP=OFF \
|
2017-06-12 15:13:03 +02:00
|
|
|
-DWITH_TBB=ON \
|
2017-07-11 08:24:11 +02:00
|
|
|
%ifarch %{ix86}
|
2013-05-16 18:12:20 +02:00
|
|
|
-DENABLE_SSE=0 \
|
|
|
|
-DENABLE_SSE2=0 \
|
|
|
|
%endif
|
2017-07-11 08:24:11 +02:00
|
|
|
-DENABLE_SSE3=0
|
2011-07-07 14:28:27 +02:00
|
|
|
make %{?_smp_mflags} VERBOSE=1
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2017-07-11 08:24:11 +02:00
|
|
|
%check
|
|
|
|
%if %{with tests}
|
|
|
|
export LD_LIBRARY_PATH=$(pwd)/build/lib:$LD_LIBRARY_PATH
|
|
|
|
%ctest
|
|
|
|
%endif
|
|
|
|
|
2010-03-08 18:16:50 +01:00
|
|
|
%install
|
2017-07-11 08:24:11 +02:00
|
|
|
%cmake_install
|
2015-12-27 01:59:41 +01:00
|
|
|
mkdir -p %{buildroot}%{_docdir}/%{name}-doc
|
2012-07-22 15:17:05 +02:00
|
|
|
mv %{buildroot}%{_datadir}/OpenCV/samples %{buildroot}%{_docdir}/%{name}-doc/examples
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
# Fix rpmlint warning "doc-file-dependency"
|
|
|
|
chmod 644 %{buildroot}%{_docdir}/%{name}-doc/examples/python/*.py
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%fdupes -s %{buildroot}%{_docdir}/%{name}-doc/examples
|
|
|
|
%fdupes -s %{buildroot}%{_includedir}
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%post -n %{libname}%{soname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libname}%{soname} -p /sbin/ldconfig
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2015-12-16 17:41:36 +01:00
|
|
|
%{_bindir}/opencv_*
|
2012-07-22 15:17:05 +02:00
|
|
|
%{_datadir}/OpenCV
|
|
|
|
%exclude %{_datadir}/OpenCV/OpenCVConfig*.cmake
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%files -n %{libname}%{soname}
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_libdir}/lib*.so.*
|
|
|
|
|
2010-04-25 18:45:15 +02:00
|
|
|
%files devel
|
2013-08-01 15:56:40 +02:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_includedir}/opencv/
|
|
|
|
%{_includedir}/opencv2/
|
2010-03-08 18:16:50 +01:00
|
|
|
%{_libdir}/lib*.so
|
2015-12-16 17:41:36 +01:00
|
|
|
%{_libdir}/pkgconfig/opencv.pc
|
2012-07-22 15:17:05 +02:00
|
|
|
%{_datadir}/OpenCV/OpenCVConfig*.cmake
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2016-03-26 15:20:54 +01:00
|
|
|
%files -n python-%{name}
|
2013-08-01 15:56:40 +02:00
|
|
|
%defattr(-,root,root,-)
|
2011-08-18 09:52:40 +02:00
|
|
|
%{python_sitearch}/cv2.so
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2016-03-26 15:20:54 +01:00
|
|
|
%files -n python3-%{name}
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{python3_sitearch}/cv2.%{py3_soflags}.so
|
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_docdir}/%{name}-doc/
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%changelog
|