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
#
2015-05-10 10:53:32 +02:00
# Copyright (c) 2015 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/
#
%bcond_with ffmpeg
%define libname lib%{name}
2013-08-01 15:56:40 +02:00
%define soname 2_4
Name : opencv
2015-05-10 10:53:32 +02:00
Version : 2.4.11
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/
2014-03-13 20:43:49 +01:00
Source0 : https://github.com/Itseez/%{name} /archive/%{version} .tar.gz
2012-01-04 07:25:38 +01:00
# PATCH-FIX-UPSTREAM opencv-samples.patch koprok@nand.bg -- Improve samples installation.
2011-08-24 14:04:40 +02:00
Patch1 : %{name} -samples.patch
2013-11-18 13:09:08 +01:00
# PATCH-FIX-OPENSUSE improve-sphinx-search.diff -- properly find sphinx with alphabetic chars in version
Patch3 : improve-sphinx-search.diff
2013-12-02 07:25:53 +01:00
# 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
2014-01-19 21:42:03 +01:00
# PATCH-FIX-UPSTREAM opencv-altivec-vector.patch -- use __vector for altivec. https://github.com/Itseez/opencv/pull/2157
2013-12-02 07:25:53 +01:00
Patch4 : opencv-pkgconfig.patch
2014-01-19 21:42:03 +01:00
Patch5 : opencv-altivec-vector.patch
2015-05-10 10:53:32 +02:00
# PATCH-FIX-UPSTREAM opencv-gcc5.patch -- support gcc versions without minor version coolo@suse.de
Patch6 : opencv-gcc5.patch
2011-07-07 14:28:27 +02:00
BuildRequires : cmake
2011-10-18 14:24:16 +02:00
BuildRequires : fdupes
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}
BuildRequires : libffmpeg-devel
%endif
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
2012-05-16 21:08:46 +02:00
BuildRequires : python-devel
2011-10-18 14:24:16 +02:00
BuildRequires : python-numpy-devel
2013-08-01 15:56:40 +02:00
BuildRequires : python-sphinx
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
2011-10-18 14:24:16 +02:00
Group : Development/Libraries/C and C++
2013-11-18 13:09:08 +01:00
# Since 2.4.7
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.
%package -n python-%{name}
Summary : Python bindings for apps which use OpenCV
2011-10-18 14:24:16 +02:00
Group : Development/Libraries/Python
Requires : python-base = %{py_ver}
%py_requires
2010-03-08 18:16:50 +01:00
%description -n python-%{name}
This package contains Python bindings for the OpenCV library.
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
2013-04-14 10:36:13 +02:00
%setup -q
2010-04-16 01:10:55 +02:00
%patch1 -p1
2013-11-18 13:09:08 +01:00
%patch3 -p0
2015-05-10 10:53:32 +02:00
#%patch4 -p1
2014-01-19 21:42:03 +01:00
%patch5 -p1
2014-04-04 16:39:52 +02:00
%patch6 -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
sed -i 's/\r$//' samples/c/facedetect.cmd
2010-03-08 18:16:50 +01:00
%build
2013-06-28 11:51:00 +02:00
export CFLAGS=" %{optflags} $ ( g e t c o n f L F S _ C F L A G S ) "
export CXXFLAGS=" %{optflags} $ ( g e t c o n f L F S _ C F L A G S ) "
2011-07-07 14:28:27 +02:00
mkdir build
2010-03-08 18:16:50 +01:00
cd build
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 \
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
mkdir -p %{buildroot} %{_docdir}
2012-07-22 15:17:05 +02:00
mv %{buildroot} %{_datadir} /OpenCV/doc %{buildroot} %{_docdir} /%{name} -doc
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
chmod 644 %{buildroot} %{_docdir} /%{name} -doc/examples/python2/*.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,-)
%{_bindir} /%{name} _*
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
%{_libdir} /pkgconfig/%{name} .pc
2012-07-22 15:17:05 +02:00
%{_datadir} /OpenCV/OpenCVConfig*.cmake
2010-03-08 18:16:50 +01:00
%files -n python-%{name}
2013-08-01 15:56:40 +02:00
%defattr (-,root,root,-)
2011-08-24 14:04:40 +02:00
%{python_sitearch} /cv.py
2011-08-18 09:52:40 +02:00
%{python_sitearch} /cv2.so
2010-03-08 18:16:50 +01:00
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