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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2016-07-28 23:43:33 +02:00
|
|
|
%bcond_without ffmpeg
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%define libname lib%{name}
|
2017-06-12 15:13:03 +02:00
|
|
|
%define soname 3_2
|
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
|
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
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: cmake
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: fdupes
|
2016-03-05 11:21:23 +01:00
|
|
|
BuildRequires: unzip
|
2014-04-04 16:39:52 +02:00
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
BuildRequires: gstreamer-plugins-base-devel
|
|
|
|
%else
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: gstreamer-0_10-plugins-base-devel
|
2014-04-30 15:10:07 +02:00
|
|
|
BuildRequires: libucil-devel
|
|
|
|
BuildRequires: libunicap-devel
|
2014-04-04 16:39:52 +02:00
|
|
|
%endif
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: libdc1394-devel
|
2013-08-01 15:56:40 +02:00
|
|
|
%if 0%{?suse_version} > 1230
|
|
|
|
BuildRequires: libeigen3-devel
|
|
|
|
%else
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: libeigen2-devel
|
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
|
2016-03-05 11:21:23 +01:00
|
|
|
BuildRequires: libgphoto2-devel
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: libjasper-devel
|
2012-03-20 11:30:49 +01:00
|
|
|
BuildRequires: libjpeg-devel
|
2013-08-01 15:56:40 +02:00
|
|
|
BuildRequires: libqt4-devel
|
2012-03-20 11:30:49 +01:00
|
|
|
BuildRequires: libtiff-devel
|
2013-08-01 15:56:40 +02:00
|
|
|
BuildRequires: libv4l-devel
|
|
|
|
%if 0%{?suse_version} > 1220
|
|
|
|
BuildRequires: ilmbase-devel
|
|
|
|
BuildRequires: openexr-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: OpenEXR-devel
|
|
|
|
BuildRequires: libilmbase-devel
|
|
|
|
%endif
|
2015-05-10 10:53:32 +02:00
|
|
|
BuildRequires: libpng16-compat-devel
|
|
|
|
BuildRequires: libpng16-devel
|
2017-06-12 15:13:03 +02:00
|
|
|
BuildRequires: openblas-devel
|
2012-05-16 21:08:46 +02:00
|
|
|
BuildRequires: python-devel
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: python-numpy-devel
|
2016-03-26 15:20:54 +01:00
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-numpy-devel
|
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
|
2017-06-12 15:13:03 +02:00
|
|
|
BuildRequires: tbb-devel
|
2012-01-10 14:51:10 +01:00
|
|
|
BuildRequires: zlib-devel
|
2012-09-23 08:08:39 +02:00
|
|
|
BuildRequires: pkgconfig(glu)
|
2013-08-01 15:56:40 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
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}
|
|
|
|
Summary: Development files for using the OpenCV library
|
2011-10-18 14:24:16 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
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
|
2013-11-18 13:09:08 +01:00
|
|
|
# Since 2.4.7
|
2017-06-12 15:13:03 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2013-11-18 13:09:08 +01:00
|
|
|
Provides: %{name}-devel-static = %{version}
|
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)
|
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
|
2016-03-26 15:20:54 +01:00
|
|
|
Requires: python-base >= %{py_ver}
|
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
|
|
|
|
Requires: python3-base >= %{py3_ver}
|
|
|
|
|
|
|
|
%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
|
2011-10-18 14:24:16 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Recommends: python
|
2010-03-08 18:16:50 +01:00
|
|
|
# Since this package also contains examples that need -devel to be compiled
|
2010-04-25 18:45:15 +02:00
|
|
|
Recommends: %{name}-devel
|
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
|
2016-01-28 17:18:35 +01:00
|
|
|
%patch8 -p1
|
2017-06-12 15:13:03 +02:00
|
|
|
%patch10 -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
|
2013-08-01 15:56:40 +02:00
|
|
|
# Fix "wrong-file-end-of-line-encoding" rpmlint warning
|
2016-03-05 11:21:23 +01:00
|
|
|
# sed -i 's/\r$//' samples/c/facedetect.cmd
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%build
|
2016-06-14 23:05:35 +02:00
|
|
|
%ifarch ppc64le
|
|
|
|
if [ $(gcc -dumpversion) -ge 6 ]; then
|
|
|
|
export mlra=-mlra
|
|
|
|
fi
|
|
|
|
%endif
|
2013-06-28 11:51:00 +02:00
|
|
|
export CFLAGS="%{optflags} $(getconf LFS_CFLAGS)"
|
2016-06-14 23:05:35 +02:00
|
|
|
export CXXFLAGS="%{optflags} ${mlra} $(getconf LFS_CFLAGS)"
|
2011-07-07 14:28:27 +02:00
|
|
|
mkdir build
|
2010-03-08 18:16:50 +01:00
|
|
|
cd build
|
2017-06-12 15:13:03 +02:00
|
|
|
# TODO for OCV 3.3: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
2011-10-18 14:24:16 +02:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
2010-03-08 18:16:50 +01:00
|
|
|
-DCMAKE_INSTALL_PREFIX='%{_prefix}' \
|
2011-10-18 14:24:16 +02:00
|
|
|
-DCMAKE_SKIP_RPATH=ON \
|
|
|
|
-DBUILD_TESTS=OFF \
|
|
|
|
-DINSTALL_C_EXAMPLES=ON \
|
|
|
|
-DINSTALL_PYTHON_EXAMPLES=ON \
|
2011-07-07 14:28:27 +02:00
|
|
|
-DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
|
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 \
|
2014-04-04 16:39:52 +02:00
|
|
|
%if 0%{?suse_version} <= 1310
|
|
|
|
-DWITH_GSTREAMER_0_10=ON \
|
|
|
|
%endif
|
2013-05-16 18:12:20 +02:00
|
|
|
%ifnarch x86_64
|
|
|
|
-DENABLE_SSE=0 \
|
|
|
|
-DENABLE_SSE2=0 \
|
|
|
|
%endif
|
|
|
|
-DENABLE_SSE3=0 \
|
2010-03-08 18:16:50 +01:00
|
|
|
..
|
2011-07-07 14:28:27 +02:00
|
|
|
make %{?_smp_mflags} VERBOSE=1
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
cd build
|
2011-07-07 14:28:27 +02:00
|
|
|
make DESTDIR=%{?buildroot:%{buildroot}} install/fast
|
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
|
2017-06-12 15:13:03 +02:00
|
|
|
# OpenCV 3.2 no longer install libopencv_ts.a if the tests are not enabled
|
|
|
|
install lib/libopencv_ts.a %{buildroot}%{_libdir}
|
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
|
2010-03-08 18:16:50 +01:00
|
|
|
|
2013-08-01 15:56:40 +02:00
|
|
|
%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/
|
2013-11-18 13:09:08 +01:00
|
|
|
%{_libdir}/libopencv_ts.a
|
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,-)
|
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
%{python3_sitearch}/cv2.%{py3_soflags}.so
|
|
|
|
%else
|
|
|
|
%{python3_sitearch}/cv2.so
|
|
|
|
%endif
|
|
|
|
|
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
|