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
#
2011-01-14 15:36:03 +01:00
# Copyright (c) 2011 SUSE LINUX Products 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
Name : opencv
%define libname lib%{name}
2011-08-18 09:52:40 +02:00
%define soname 2_3
Version : 2.3.0
2011-08-18 14:03:54 +02:00
Release : 14
2010-03-08 18:16:50 +01:00
License : BSD3c
2011-07-07 14:28:27 +02:00
Summary : Collection of algorithms for computer vision
2010-03-08 18:16:50 +01:00
Url : http://%{name} .willowgarage.com/wiki/
2011-07-07 14:28:27 +02:00
Group : Development/Libraries
2011-08-18 09:52:40 +02:00
Source0 : http://downloads.sourceforge.net/project/%{name} library/%{name} -unix/2.3/OpenCV-%{version} .tar.bz2
Patch0 : %{name} -2.3-libdir.patch
Patch1 : %{name} -2.3-samples.patch
2011-08-18 14:03:44 +02:00
# PATCH-FIX-UPSTREAM %{name}-2.3-underlinking.patch reddwarf@opensuse.org -- Make libopencv_highgui.so link to libv4l2 since it's using symbols defined there.
Patch3 : %{name} -2.3-underlinking.patch
2011-08-18 09:52:40 +02:00
Patch7 : %{name} -2.3-cmake.patch
2011-08-18 14:03:44 +02:00
# PATCH-FIX-UPSTREAM %{name}-2.3-ffmpeg.patch reddwarf@opensuse.org -- Allows to compile with latest ffmpeg. Took from upstream SVN.
2011-08-18 09:52:40 +02:00
Patch8 : %{name} -2.3-ffmpeg.patch
%if 0%{?suse_version} >= 1120
2011-07-07 14:28:27 +02:00
BuildRequires : gstreamer-0_10-plugins-base-devel
2011-08-18 09:52:40 +02:00
BuildRequires : gstreamer-0_10-devel
%endif
2010-03-08 18:16:50 +01:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2010-04-25 18:45:15 +02:00
%if 0%{?suse_version} >= 1110
2011-07-07 14:28:27 +02:00
BuildRequires : libdc1394-devel
BuildRequires : libxine-devel
2010-04-25 18:45:15 +02:00
%else
BuildRequires : xine-devel
%endif
2011-07-07 14:28:27 +02:00
BuildRequires : OpenEXR-devel
BuildRequires : cmake
BuildRequires : gcc-c++
BuildRequires : libjasper-devel
BuildRequires : libjpeg-devel
BuildRequires : libpng-devel
BuildRequires : libtiff-devel
BuildRequires : python-devel
BuildRequires : zlib-devel
2011-08-18 09:52:40 +02:00
BuildRequires : libqt4-devel
2010-03-08 18:16:50 +01:00
%if %{with ffmpeg}
BuildRequires : libffmpeg-devel
%endif
2011-01-14 15:35:53 +01:00
%if 0%{?suse_version} >= 1130
BuildRequires : python-numpy-devel
%endif
2011-08-18 09:52:40 +02:00
%if 0%{?suse_version} >= 1120
BuildRequires : python-numpy
%endif
2011-07-07 14:28:27 +02:00
%if 0%{?suse_version} < 1210
BuildRequires : libv4l-devel
%else
BuildRequires : libv4l-devel >= 0.8.4
%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}
2011-07-07 14:28:44 +02:00
2010-03-08 18:16:50 +01:00
Summary : Development files for using the OpenCV library
Group : Development/Libraries
%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
License : BSD3c
2010-04-07 21:12:07 +02:00
2010-03-08 18:16:50 +01:00
Summary : Development files for using the OpenCV library
Group : Development/Libraries
Requires : %{libname} %{soname} = %{version}
Requires : %{name} = %{version}
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}
2011-07-07 14:28:44 +02:00
2010-03-08 18:16:50 +01:00
Summary : Python bindings for apps which use OpenCV
Group : Development/Libraries
Requires : python-base
%description -n python-%{name}
This package contains Python bindings for the OpenCV library.
%package -n %{name}-doc
2011-07-07 14:28:44 +02:00
2010-03-08 18:16:50 +01:00
Summary : Documentation and examples for OpenCV
Group : Documentation
# 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
%description -n %{name}-doc
This package contains the documentation and examples for the OpenCV library.
%prep
%setup -qn OpenCV-%{version}
2010-04-16 01:10:55 +02:00
%patch0 -p1
%patch1 -p1
2011-08-18 14:03:44 +02:00
%patch3
2011-08-18 09:52:40 +02:00
%patch7 -p1
%if %{with ffmpeg}
%patch8
2011-07-07 14:28:27 +02:00
%endif
2010-03-08 18:16:50 +01:00
# Windows specific and with wrong end of line
2011-07-07 14:28:27 +02:00
rm -f doc/packaging.txt
chmod +x samples/c/build_all.sh
2010-04-25 18:45:15 +02:00
sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
2011-01-14 15:35:53 +01:00
samples/c/latentsvmdetect.cpp \
samples/gpu/hog.cpp \
2010-04-25 18:45:15 +02:00
samples/python/camshift.py
2010-03-08 18:16:50 +01:00
%build
2011-07-07 14:28:27 +02:00
export CFLAGS=" %{optflags} "
export CXXFLAGS=" %{optflags} "
mkdir build
2010-03-08 18:16:50 +01:00
cd build
cmake -DCMAKE_SKIP_RPATH=ON \
-DCMAKE_INSTALL_PREFIX='%{_prefix}' \
2011-07-07 14:28:27 +02:00
-DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
2010-03-08 18:16:50 +01:00
-DCMAKE_BUILD_TYPE=Release \
-DUSE_OMIT_FRAME_POINTER=OFF \
2010-04-25 18:45:15 +02:00
-DWITH_XINE=ON \
2011-08-18 09:52:40 +02:00
-DWITH_QT=ON \
%if 0%{?suse_version} >= 1130
-DWITH_QT_OPENGL=ON \
%endif
2010-04-25 18:45:15 +02:00
-DBUILD_TESTS=OFF \
2010-03-08 18:16:50 +01:00
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
..
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}
mv %{buildroot} %{_datadir} /%{name} /doc %{buildroot} %{_docdir} /%{name} -doc
mv %{buildroot} %{_datadir} /%{name} /samples %{buildroot} %{_docdir} /%{name} -doc/examples
2010-03-08 18:16:50 +01:00
%clean
rm -rf %{buildroot}
%post -n %{libname}%{soname} -p /sbin/ldconfig
%postun -n %{libname}%{soname} -p /sbin/ldconfig
%files -n %{libname}%{soname}
2010-04-25 18:45:15 +02:00
%defattr (-, root, root, 0755)
2010-03-08 18:16:50 +01:00
%{_libdir} /lib*.so.*
%files -n %{name}
%defattr (0644, root, root, 0755)
%attr (0755, root, root) %{_bindir} /%{name} _*
%{_datadir} /%{name}
%exclude %{_datadir} /%{name} /OpenCVConfig.cmake
2010-04-25 18:45:15 +02:00
%files devel
2010-03-08 18:16:50 +01:00
%defattr (0644, root, root, 0755)
2011-01-14 15:35:53 +01:00
%{_includedir} /opencv
%{_includedir} /opencv2
2010-03-08 18:16:50 +01:00
%{_libdir} /lib*.so
%{_libdir} /pkgconfig/%{name} .pc
%{_datadir} /%{name} /OpenCVConfig.cmake
%files -n python-%{name}
%defattr (0644, root, root, 0755)
%if 0%{?suse_version} < 1120
%{py_sitedir} /cv.so
%else
%{python_sitearch} /cv.so
2011-08-18 09:52:40 +02:00
%{python_sitearch} /cv2.so
2010-03-08 18:16:50 +01:00
%endif
%files -n %{name}-doc
%defattr (-, root, root, 0755)
%{_docdir} /%{name} -doc
%changelog