# # spec file for package opencv # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # 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/ # %bcond_with ffmpeg %define libname lib%{name} %define soname 2_4 Name: opencv Version: 2.4.11 Release: 19.7 Summary: Collection of algorithms for computer vision License: BSD-3-Clause Group: Development/Libraries/C and C++ Url: http://opencv.org/ Source0: https://github.com/Itseez/%{name}/archive/%{version}.tar.gz # PATCH-FIX-UPSTREAM opencv-samples.patch koprok@nand.bg -- Improve samples installation. Patch1: %{name}-samples.patch # PATCH-FIX-OPENSUSE improve-sphinx-search.diff -- properly find sphinx with alphabetic chars in version Patch3: improve-sphinx-search.diff # PATCH-FIX-UPSTREAM opencv-pkgconfig.patch -- Make sure to provide link flags in OpenCV pc file (bnc#853036). Issue is exposed when e.g. a project relies on # getting opencv vars via pc (first), and then via CMake, as is the case with nomacs # PATCH-FIX-UPSTREAM opencv-altivec-vector.patch -- use __vector for altivec. https://github.com/Itseez/opencv/pull/2157 Patch4: opencv-pkgconfig.patch Patch5: opencv-altivec-vector.patch # PATCH-FIX-UPSTREAM opencv-gcc5.patch -- support gcc versions without minor version coolo@suse.de Patch6: opencv-gcc5.patch BuildRequires: cmake BuildRequires: fdupes %if 0%{?suse_version} > 1310 BuildRequires: gstreamer-plugins-base-devel %else BuildRequires: gstreamer-0_10-plugins-base-devel BuildRequires: libucil-devel BuildRequires: libunicap-devel %endif BuildRequires: libdc1394-devel %if 0%{?suse_version} > 1230 BuildRequires: libeigen3-devel %else BuildRequires: libeigen2-devel %endif %if %{with ffmpeg} BuildRequires: libffmpeg-devel %endif BuildRequires: libjasper-devel BuildRequires: libjpeg-devel BuildRequires: libqt4-devel BuildRequires: libtiff-devel BuildRequires: libv4l-devel %if 0%{?suse_version} > 1220 BuildRequires: ilmbase-devel BuildRequires: openexr-devel %else BuildRequires: OpenEXR-devel BuildRequires: libilmbase-devel %endif BuildRequires: libpng16-compat-devel BuildRequires: libpng16-devel BuildRequires: python-devel BuildRequires: python-numpy-devel BuildRequires: python-sphinx BuildRequires: zlib-devel BuildRequires: pkgconfig(glu) BuildRoot: %{_tmppath}/%{name}-%{version}-build %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 Group: Development/Libraries/C and C++ %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. %package devel Summary: Development files for using the OpenCV library Group: Development/Libraries/C and C++ # Since 2.4.7 Provides: %{name}-devel-static = %{version} Requires: %{libname}%{soname} = %{version} Requires: %{name} = %{version} Requires: pkgconfig(gl) Requires: pkgconfig(glu) Requires: pkgconfig(ice) Requires: pkgconfig(sm) Requires: pkgconfig(x11) Requires: pkgconfig(xext) %description devel 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. %package -n python-%{name} Summary: Python bindings for apps which use OpenCV Group: Development/Libraries/Python Requires: python-base = %{py_ver} %py_requires %description -n python-%{name} This package contains Python bindings for the OpenCV library. %package doc Summary: Documentation and examples for OpenCV Group: Development/Libraries/C and C++ Recommends: python # Since this package also contains examples that need -devel to be compiled Recommends: %{name}-devel %description doc This package contains the documentation and examples for the OpenCV library. %prep %setup -q %patch1 -p1 %patch3 -p0 #%patch4 -p1 %patch5 -p1 %patch6 -p1 # Remove Windows specific files rm -f doc/packaging.txt # Fix "wrong-file-end-of-line-encoding" rpmlint warning sed -i 's/\r$//' samples/c/facedetect.cmd %build export CFLAGS="%{optflags} $(getconf LFS_CFLAGS)" export CXXFLAGS="%{optflags} $(getconf LFS_CFLAGS)" mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX='%{_prefix}' \ -DCMAKE_SKIP_RPATH=ON \ -DBUILD_TESTS=OFF \ -DINSTALL_C_EXAMPLES=ON \ -DINSTALL_PYTHON_EXAMPLES=ON \ -DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \ -DENABLE_OMIT_FRAME_POINTER=OFF \ -DWITH_QT=OFF \ -DWITH_OPENGL=OFF \ -DWITH_UNICAP=OFF \ -DWITH_XINE=OFF \ %if 0%{?suse_version} <= 1310 -DWITH_GSTREAMER_0_10=OFF \ %endif %ifnarch x86_64 -DENABLE_SSE=0 \ -DENABLE_SSE2=0 \ %endif -DENABLE_SSE3=0 \ .. make %{?_smp_mflags} VERBOSE=1 %install cd build make DESTDIR=%{?buildroot:%{buildroot}} install/fast mkdir -p %{buildroot}%{_docdir} mv %{buildroot}%{_datadir}/OpenCV/doc %{buildroot}%{_docdir}/%{name}-doc mv %{buildroot}%{_datadir}/OpenCV/samples %{buildroot}%{_docdir}/%{name}-doc/examples # Fix rpmlint warning "doc-file-dependency" chmod 644 %{buildroot}%{_docdir}/%{name}-doc/examples/python/*.py chmod 644 %{buildroot}%{_docdir}/%{name}-doc/examples/python2/*.py %fdupes -s %{buildroot}%{_docdir}/%{name}-doc/examples %fdupes -s %{buildroot}%{_includedir} %post -n %{libname}%{soname} -p /sbin/ldconfig %postun -n %{libname}%{soname} -p /sbin/ldconfig %files %defattr(-,root,root,-) %{_bindir}/%{name}_* %{_datadir}/OpenCV %exclude %{_datadir}/OpenCV/OpenCVConfig*.cmake %files -n %{libname}%{soname} %defattr(-,root,root,-) %{_libdir}/lib*.so.* %files devel %defattr(-,root,root,-) %{_includedir}/opencv/ %{_includedir}/opencv2/ %{_libdir}/libopencv_ts.a %{_libdir}/lib*.so %{_libdir}/pkgconfig/%{name}.pc %{_datadir}/OpenCV/OpenCVConfig*.cmake %files -n python-%{name} %defattr(-,root,root,-) %{python_sitearch}/cv.py %{python_sitearch}/cv2.so %files doc %defattr(-,root,root,-) %{_docdir}/%{name}-doc/ %changelog * Fri Jul 24 2015 mlin@suse.com - Update improve-sphinx-search.diff for new python-Sphinx(1.3.1) * now that sphinx-build disallow executing without arguments and give you "Insufficient arguments" error, use "sphinx-build -h" instead * the default usages output ie. sphinx-build(or --help) no longer are standard error but standard output, drop OUTPUT_QUIET and add OUTPUT_VARIABLE throws the output to SPHINX_OUTPUT as well * Wed Apr 29 2015 coolo@suse.com - support gcc 5 (i.e. gcc versions without minor version): opencv-gcc5.patch * Wed Apr 29 2015 coolo@suse.com - Update to OpenCV 2.4.11 - can't find NEWS or Changelog merely collecting bug fixes while 3.0 is in the making, 2.4.11 didn't even make it on their web page, it's only on download server - remove opencv-underlinking.patch as obsolete - remove upstream patch bomb_commit_gstreamer-1x-support.patch - commenting out opencv-pkgconfig.patch - possibly it requires a rebase, but the problem it tries to solve is unclear * Mon Jan 26 2015 tittiatcoke@gmail.com - Add specific buildrequires for libpng15, so that we are building against the system provided libpng. * Tue May 13 2014 koprok@gmail.com - Update to OpenCV 2.4.9 More info at: http://opencv.org/opencv-2-4-9-is-out.html The brief list of changes: * new 3D visualization module ‘viz’; * performance fixes in ‘ocl’ module; * fixes in Android Camera; * improved CUDA support for mobile platforms; * bugfixes from community; * 55 reported bugs have been closed; * 156 pull requests have been merged. * Sun Apr 6 2014 tittiatcoke@gmail.com - Drop the BuildRequires on libucil and libunicap for Factory. This stops us from getting ride of Gstreamer 0.10 and besides these two libraries seem to be unmaintained upstream as that the latest actions are from 2010 * Thu Apr 3 2014 tittiatcoke@gmail.com - Add upstream patch (3.0 version) to support Gstreamer 1.x * bomb_commit_gstreamer-1x-support.patch * Thu Mar 13 2014 tchvatal@suse.com - Upstream now provides tarballs with source only as git tags from github so update Source0 path. * Wed Mar 12 2014 tchvatal@suse.com - Add requires on various X extensions linked to opencv_ts module. As those are present in the .pc file we need it anyway. * Sun Jan 19 2014 koprok@gmail.com - Update to OpenCV 2.4.8 More info at: http://opencv.org/opencv-2-4-8.html The brief list of changes: * NVidia CUDA support on Android devices with CUDA capable SoC and CUDA sample; * Concurrent kernel execution and user defined context support for OpenCL; * Integration with Intel Perceptual SDK and new depth sensors support for Windows; * 32 reported bugs have been closed; * 139 pull requests have been merged; * Thu Jan 16 2014 dvlaeev@suse.com - Fix build with altivec: opencv-altivec-vector.patch * Sun Dec 1 2013 hrvoje.senjan@gmail.com - Added opencv-pkgconfig.patch: make sure to provide link flags in OpenCV pc file (bnc#853036) * Tue Nov 12 2013 hrvoje.senjan@gmail.com - Update to OpenCV 2.4.7 More info at: http://opencv.org/opencv-2-4-7-is-out.html The brief list of changes: * dynamic OpenCL runtime loading, setting default OpenCL device via env var, many bug-fixes and some new optimization with OpenCL * bug-fixes and new optimizations in CUDA stuff * latest NDK and Android OS support, Native Android Camera tuning * minor fixes, XAML sample and MS Certification compatibility in WinRT stuff * 382 pull requests have been merged * 54 reported bugs have been fixed - Added pkgconfig(glu) Requires to devel package, as per .pc file - Make devel package provides also devel-static one - Drop assume-Sphinx-is-there.diff, and add improve-sphinx-search.diff, for properly finding sphinx with alphabetic chars in version * Sun Nov 10 2013 tittiatcoke@gmail.com - Add patch assume-Sphinx-is-there.diff to fix building with Sphinx versions that have alphanumeric characters in the version (Only for factory builds at the moment) * Sun Jul 14 2013 asterios.dramis@gmail.com - Use eigen3 instead of eigen2 as build requirement for openSUSE > 12.3. - Enable compilation with libucil and libunicap. - Removed dos2unix build requirement (not needed anymore). * Fri Jul 12 2013 koprok@nand.bg - Update to OpenCV 2.4.6.1 More info at: http://opencv.org/opencv-2-4-6-is-out.html The brief list of changes: * added video file i/o Windows RT and sample application using camera, enabled parallelization with TBB or MS Concurrency * added CUDA 5.5 support for desktop and ARM systems * added Qt 5 support * added many new OpenCL algorithms ports, included OpenCL binaries into the Windows superpack * iOS build scripts (together with Android ones) moved to ‘opencv/platforms’ directory * added functions for UIImage <-> cv::Mat conversion * correct front/back camera selection in Android app framework * added Linaro NDK support and fixes for MIPS to Android CMake toolchain * stability has been improved by a lot, numerous bug-fixes across all the library * Wed Jun 26 2013 crrodriguez@opensuse.org - build with LFS_CFLAGS in 32 bit archs. * Fri May 10 2013 hrvoje.senjan@gmail.com - Disable SSE3 for all architectures (bnc#814333) * Thu May 9 2013 hrvoje.senjan@gmail.com - Disable SSE(2) on non x86_64 architectures, causes crashing kde#276923, bnc#789173 * Thu Apr 11 2013 koprok@nand.bg - Update to OpenCV 2.4.5 More info at: http://opencv.org/opencv-2-4-5-is-out.html The brief list of changes: * experimental WinRT support * new video super-resolution module * CLAHE (adaptive histogram equalization) algorithm on both CPU and GPU * further improvements and extensions in ocl module (stereo block matching and belief propagation have been added, fixed crashes on Intel HD4000) * Visual Studio 2012 cv::Mat visualizer plugin debugger tutorial from Microsoft Research * OpenCV4Android SDK improvements (NDK r8e support, native activity sample using OpenCV Manager, bug-fixes) * ~25 reported problems have been resolved since 2.4.4, ~78 pull requests have been merged, thanks everybody who participated! * Tue Mar 5 2013 koprok@nand.bg - Update to OpenCV 2.4.4 More info at: http://opencv.org/opencv-2-4-4-is-out.html The brief list of changes: * OpenCV Java bindings are ported from Android to desktop Java! Actually any JVM language will work, see Tutorial for details, and Java or Scala code samples. * Android application framework, samples, tutorials, and OpenCV Manager are improved. * Optimizations for the new NVIDIA Kepler architecture, CARMA platform support and other new optimizations in CUDA. * OpenCL module now builds successfully with various SDKs (from AMD, NVIDIA, Intel and Apple) and runs well on different GPUs (AMD, NVidia, Intel HD4000). A lot of new functionality has been added, tons of bugs fixed, performance of many functions has been significantly improved. * 100+ reported problems have been resolved since 2.4.3, thanks everybody who participated! * Sat Dec 1 2012 tittiatcoke@gmail.com - Drop the buildrequire for libxine * Wed Nov 28 2012 koprok@nand.bg - Update to OpenCV 2.4.3 More info at: http://opencv.org/opencv-2-4-3-released.html The nicely formatted changelog can be seen here: http://code.opencv.org/projects/opencv/wiki/ChangeLog; here are the highlights: * A lot of good stuff from the Google Summer of Code 2012 has been integrated; this was a very productive summer! * Significantly improved and optimized Android and iOS ports. * Greatly extended GPU (i.e. CUDA-based) module. * The brand new ocl (OpenCL-based) module that unleashes GPU power also for AMD and Intel GPU users. It’s not included into the binary package, since there are different SDKs, and it’s not turned on by default. You need to run CMake and turn on “WITH_OPENCL”. Also, please note that this is very first version of the module, so it may be not very stable and not very functional. * Much better performance on many-core systems out of the box. You do not need TBB anymore on MacOSX, iOS and Windows. BTW, the binary package for Windows is now built without TBB support. Libraries and DLLs for Visual Studio 2010 use the Concurrency framework. * About 130 bugs have been fixed since 2.4.2. * Since 2.4.3rc we fixed several more problems, in particular some compile problems with iOS 6 SDK. * Tue Sep 18 2012 coolo@suse.com - buildrequire glu * Thu Jul 5 2012 koprok@nand.bg - Update to OpenCV 2.4.2 More info at: http://code.opencv.org/projects/opencv/wiki/ChangeLog - Drop opencv-datadir.patch to comply with upstream directory layout * Fri Jun 8 2012 koprok@nand.bg - Update to OpenCV 2.4.1 More info at: http://code.opencv.org/projects/opencv/wiki/ChangeLog * Tue May 15 2012 koprok@nand.bg - Update to OpenCV 2.4.0 More info at: http://code.opencv.org/projects/opencv/wiki/ChangeLog * Sat Mar 17 2012 dimstar@opensuse.org - Add opencv-gcc47.patch: Fix build with gcc 4.7. * Tue Jan 10 2012 crrodriguez@opensuse.org - Use Explicit Buildrequires on several needed libraries future dependency cleanups may/will cause build to fail otherwise. * Sat Dec 31 2011 idonmez@suse.com - Add upstream r6881 to fix clang compatibility * Tue Oct 18 2011 coolo@suse.com - uncomment libraries not in 12.1 for now * Fri Oct 7 2011 toddrme2178@gmail.com - Changed groups (fix for RPMLINT warning) - Added check for duplicate files (fix for RPMLINT warning) - Added py_requires macros and python-base dependencies (fix for RPMLINT warning) - Escaped macros (fix for RPMLINT warning) - Fixed end-of-line encoding problems (fix for RPMLINT warning) - Added libeigen2-devel buildrequires - Added libunicap and libucil buildrequires (libunicap supports requires libucil) - Cleaned up spec file formatting * Tue Aug 23 2011 koprok@nand.bg - Dropped opencv-2.3-ffmpeg.patch, applied upstream * Tue Aug 23 2011 koprok@nand.bg - Revive opencv-2.3-ffmpeg.patch, needs rebase - Tag all patches according to openSUSE packaging guidelines * Tue Aug 23 2011 koprok@nand.bg - Removed opencv-2.3-cmake.patch, old cmake cannot be used any more. - Python bindings cannot be built without NumPy any more. * Fri Aug 19 2011 koprok@nand.bg - Update to OpenCV 2.3.1 * Wed Aug 17 2011 reddwarf@opensuse.org - Update and readd opencv-2.3-underlinking.patch since it is still necessary. * Wed Aug 17 2011 reddwarf@opensuse.org - Fix support for new ffmpeg versions * Sat Aug 13 2011 koprok@nand.bg - Removed unnecessary patches - Enable Python NumPy support on openSUSE 11.2 - Build Qt instead of Gtk GUI - Fix cmake files for openSUSE 11.1 - No GStreamer support on openSUSE 11.1 * Fri Aug 12 2011 koprok@nand.bg - Update to OpenCV 2.3.0. More info at: http://opencv.willowgarage.com/wiki/OpenCV%%20Change%%20Logs * Tue Aug 2 2011 koprok@nand.bg - Fix build on openSUSE 11.2 * Wed Jul 6 2011 idonmez@novell.com - Add opencv-v4l-2.6.38.patch: use the new libv4l2 interface * Mon Dec 27 2010 koprok@nand.bg - Enable Python NumPy support - SWIG is not required any more - Enable OpenEXR support * Thu Dec 23 2010 koprok@nand.bg - Update to OpenCV 2.2.0. More info at: http://opencv.willowgarage.com/wiki/OpenCV%%20Change%%20Logs * Sun Dec 12 2010 cristian.rodriguez@opensuse.org - Use system zlib, oh, and do not export ZLIB symbols to other applications, clashes ensued. * Thu Nov 11 2010 dmueller@suse.de - fix build with gcc 4.6 * Fri Oct 8 2010 reddwarf@opensuse.org - add -underlinking patch * Thu Apr 22 2010 koprok@nand.bg - devel package renamed to opencv-devel, so that switching between OBS and packman opencv packages is easier * Mon Apr 19 2010 koprok@nand.bg - fix gstreamer support - fix xine support - fix some rpmlint warnings - fix shared libraries permissions * Sat Apr 17 2010 koprok@nand.bg - Do not waste resources building the tests as we do not run them * Fri Apr 16 2010 koprok@nand.bg - Do not disable SSE,SSE2,etc. According to OpenCV changelog, it should be safe to leave these enabled. * Thu Apr 15 2010 koprok@nand.bg - fix build on openSUSE 11.0 * Tue Apr 13 2010 koprok@nand.bg - Update to OpenCV 2.1.0: * The whole OpenCV is now using exceptions instead of the old libc-style mechanism * Experimental "static" OpenCV configuration in CMake was contributed by Jose Luis Blanco. Pass "BUILD_SHARED_LIBS=OFF" to CMake to build OpenCV statically. * new improved version of one-way descriptor is added * User can now control the image areas visible after the stereo rectification * Fullscreen has been added (thanks to Yannick Verdie). * Further info at: http://opencv.willowgarage.com/wiki/OpenCV%%20Change%%20Logs * Wed Apr 7 2010 coolo@novell.com - fix build with libpng14 * Thu Mar 18 2010 coolo@novell.com - small spec file cleanup * Sat Jan 16 2010 tittiatcoke@gmail.com - Moved to the KDE repositories to enable inclusion in kipi-plugins * Fri Oct 9 2009 cmorve69@yahoo.es - Initial package