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
|
|
|
#
|
2018-01-16 09:32:34 +01:00
|
|
|
# Copyright (c) 2018 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.
|
|
|
|
|
2018-11-06 15:18:16 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-03-08 18:16:50 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define libname lib%{name}
|
2018-06-02 11:53:10 +02:00
|
|
|
%define soname 3_4
|
2017-07-11 08:24:11 +02:00
|
|
|
# disabled by default as many fail
|
|
|
|
%bcond_with tests
|
|
|
|
%bcond_without qt5
|
|
|
|
%bcond_without ffmpeg
|
2018-01-16 09:32:34 +01:00
|
|
|
%bcond_without python2
|
|
|
|
%bcond_without python3
|
2018-06-02 11:53:10 +02:00
|
|
|
%bcond_without openblas
|
2013-08-01 15:56:40 +02:00
|
|
|
Name: opencv
|
2018-11-06 15:18:16 +01:00
|
|
|
Version: 3.4.3
|
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
|
2018-06-02 11:53:10 +02:00
|
|
|
# GPL-2.0 AND Apache-2.0 files are in 3rdparty/ittnotify which is not build
|
|
|
|
License: BSD-3-Clause AND GPL-2.0-only AND Apache-2.0
|
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/
|
2017-11-19 11:08:51 +01:00
|
|
|
Source0: https://github.com/opencv/opencv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2018-06-02 11:53:10 +02:00
|
|
|
# This is the FACE module from the opencv_contrib package. Packaged separately to prevent too much unstable modules
|
|
|
|
Source1: https://github.com/opencv/opencv_contrib/archive/%{version}.tar.gz#/opencv_contrib-%{version}.tar.gz
|
2017-12-03 10:10:30 +01:00
|
|
|
# PATCH-FIX-OPENCSUSE opencv-gles.patch -- Make sure PERSPECTIVE_CORRECTION_HINT is validated first, https://github.com/opencv/opencv/issues/9171
|
2018-11-06 15:18:16 +01:00
|
|
|
Patch0: 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
|
2018-11-06 15:18:16 +01:00
|
|
|
Patch1: opencv-build-compare.patch
|
2017-12-03 10:10:30 +01: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, https://github.com/opencv/opencv/issues/9171
|
2018-11-06 15:18:16 +01:00
|
|
|
Patch2: 0001-Do-not-include-glx.h-when-using-GLES.patch
|
2017-12-03 10:10:30 +01:00
|
|
|
# PATCH-FIX-OPENSUSE fix_processor_detection_for_32bit_on_64bit.patch -- Fix CPU detection for 32bit build on qemu-system-aarch64
|
2018-11-06 15:18:16 +01:00
|
|
|
Patch3: fix_processor_detection_for_32bit_on_64bit.patch
|
2018-06-02 11:53:10 +02:00
|
|
|
# PATCH-FIX-OPENSUSE remove LIB_SUFFIX from OPENCV_LIB_INSTALL_PATH because CMAKE_INSTALL_LIBDIR is arch dependent
|
2018-11-06 15:18:16 +01:00
|
|
|
Patch4: opencv-lib_suffix.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: pkgconfig
|
|
|
|
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(zlib)
|
|
|
|
Provides: opencv-qt5
|
|
|
|
Obsoletes: opencv-qt5
|
2018-06-02 11:53:10 +02:00
|
|
|
%if %{with openblas}
|
|
|
|
BuildRequires: openblas-devel
|
|
|
|
%endif
|
2018-01-16 09:32:34 +01:00
|
|
|
%if %{with python2}
|
|
|
|
BuildRequires: pkgconfig(python)
|
|
|
|
%if 0%{?suse_version} > 1325
|
|
|
|
BuildRequires: python2-numpy-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: python-numpy-devel
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if %{with python3}
|
|
|
|
BuildRequires: python3-numpy-devel
|
|
|
|
BuildRequires: pkgconfig(python3)
|
|
|
|
%endif
|
2017-07-11 08:24:11 +02:00
|
|
|
%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
|
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
|
2017-11-19 11:08:51 +01:00
|
|
|
License: BSD-3-Clause
|
2017-07-11 08:24:11 +02:00
|
|
|
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-11-19 11:08:51 +01:00
|
|
|
License: BSD-3-Clause
|
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.
|
|
|
|
|
2017-11-19 11:08:51 +01:00
|
|
|
%package -n python2-%{name}
|
2016-03-26 15:20:54 +01:00
|
|
|
Summary: Python 2 bindings for apps which use OpenCV
|
2017-11-19 11:08:51 +01:00
|
|
|
License: BSD-3-Clause
|
2011-10-18 14:24:16 +02:00
|
|
|
Group: Development/Libraries/Python
|
2017-11-19 11:08:51 +01:00
|
|
|
Provides: python-%{name} = %{version}-%{release}
|
|
|
|
Obsoletes: python-%{name} < %{version}-%{release}
|
2017-07-11 08:24:11 +02:00
|
|
|
Provides: python-%{name}-qt5
|
|
|
|
Obsoletes: python-%{name}-qt5
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2017-11-19 11:08:51 +01:00
|
|
|
%description -n python2-%{name}
|
2016-03-26 15:20:54 +01:00
|
|
|
This package contains Python 2 bindings for the OpenCV library.
|
|
|
|
|
|
|
|
%package -n python3-%{name}
|
|
|
|
Summary: Python 3 bindings for apps which use OpenCV
|
2017-11-19 11:08:51 +01:00
|
|
|
License: BSD-3-Clause
|
2016-03-26 15:20:54 +01:00
|
|
|
Group: Development/Libraries/Python
|
2017-07-11 08:24:11 +02:00
|
|
|
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-11-19 11:08:51 +01:00
|
|
|
License: BSD-3-Clause
|
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
|
|
|
|
2018-06-02 11:53:10 +02:00
|
|
|
# Only copy over modules we need
|
|
|
|
mv opencv_contrib-%{version}/modules/{face,tracking,plot} modules/
|
|
|
|
cp opencv_contrib-%{version}/LICENSE LICENSE.contrib
|
|
|
|
|
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-12-03 10:10:30 +01:00
|
|
|
# Dynamic dispatch: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
|
|
|
# x86: disable SSE on 32bit, do not dispatch AVX and later - SSE3
|
|
|
|
# is the highest extension available on any non-64bit x86 CPU
|
|
|
|
# ARM: ARMv6, e.g. RPi1, only has VFPv2
|
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}
|
2017-12-03 10:10:30 +01:00
|
|
|
-DCPU_BASELINE_DISABLE=SSE \
|
|
|
|
-DCPU_DISPATCH=SSE,SSE2,SSE3 \
|
2013-05-16 18:12:20 +02:00
|
|
|
%endif
|
2017-12-03 10:10:30 +01:00
|
|
|
%ifarch x86_64
|
|
|
|
-DCPU_BASELINE=SSE2 \
|
|
|
|
-DCPU_DISPATCH=SSE3,SSE4_1,SSE4_2,AVX,FP16,AVX2 \
|
|
|
|
%endif
|
|
|
|
%ifarch %{arm}
|
|
|
|
%ifarch armv7l armv7hl
|
|
|
|
-DCPU_BASELINE=VFPV3 \
|
|
|
|
-DCPU_DISPATCH=NEON \
|
|
|
|
%else
|
|
|
|
-DCPU_BASELINE_DISABLE=NEON,VFPV3 \
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%ifarch aarch64
|
|
|
|
-DCPU_BASELINE=NEON \
|
|
|
|
-DCPU_DISPATCH=FP16 \
|
|
|
|
%endif
|
2018-06-02 11:53:10 +02:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
-DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 \
|
|
|
|
%endif
|
2017-12-03 10:10:30 +01:00
|
|
|
|
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
|
2018-06-02 11:53:10 +02:00
|
|
|
%license LICENSE LICENSE.contrib
|
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}
|
2018-06-02 11:53:10 +02:00
|
|
|
%license LICENSE LICENSE.contrib
|
|
|
|
%{_libdir}/libopencv_calib3d.so.*
|
|
|
|
%{_libdir}/libopencv_core.so.*
|
|
|
|
%{_libdir}/libopencv_dnn.so.*
|
|
|
|
%{_libdir}/libopencv_face.so.*
|
|
|
|
%{_libdir}/libopencv_features2d.so.*
|
|
|
|
%{_libdir}/libopencv_flann.so.*
|
|
|
|
%{_libdir}/libopencv_highgui.so.*
|
|
|
|
%{_libdir}/libopencv_imgcodecs.so.*
|
|
|
|
%{_libdir}/libopencv_imgproc.so.*
|
|
|
|
%{_libdir}/libopencv_ml.so.*
|
|
|
|
%{_libdir}/libopencv_objdetect.so.*
|
|
|
|
%{_libdir}/libopencv_photo.so.*
|
|
|
|
%{_libdir}/libopencv_plot.so.*
|
|
|
|
%{_libdir}/libopencv_shape.so.*
|
|
|
|
%{_libdir}/libopencv_stitching.so.*
|
|
|
|
%{_libdir}/libopencv_superres.so.*
|
|
|
|
%{_libdir}/libopencv_tracking.so.*
|
|
|
|
%{_libdir}/libopencv_video.so.*
|
|
|
|
%{_libdir}/libopencv_videoio.so.*
|
|
|
|
%{_libdir}/libopencv_videostab.so.*
|
2013-08-01 15:56:40 +02:00
|
|
|
|
2010-04-25 18:45:15 +02:00
|
|
|
%files devel
|
2018-06-02 11:53:10 +02:00
|
|
|
%license LICENSE LICENSE.contrib
|
2013-08-01 15:56:40 +02:00
|
|
|
%{_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
|
|
|
|
2018-01-16 09:32:34 +01:00
|
|
|
%if %{with python2}
|
2017-11-19 11:08:51 +01:00
|
|
|
%files -n python2-%{name}
|
2018-06-02 11:53:10 +02:00
|
|
|
%license LICENSE LICENSE.contrib
|
2011-08-18 09:52:40 +02:00
|
|
|
%{python_sitearch}/cv2.so
|
2018-01-16 09:32:34 +01:00
|
|
|
%endif
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2018-01-16 09:32:34 +01:00
|
|
|
%if %{with python3}
|
2016-03-26 15:20:54 +01:00
|
|
|
%files -n python3-%{name}
|
2018-06-02 11:53:10 +02:00
|
|
|
%license LICENSE LICENSE.contrib
|
2016-03-26 15:20:54 +01:00
|
|
|
%{python3_sitearch}/cv2.%{py3_soflags}.so
|
2018-01-16 09:32:34 +01:00
|
|
|
%endif
|
2016-03-26 15:20:54 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%files doc
|
|
|
|
%{_docdir}/%{name}-doc/
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%changelog
|