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
|
|
|
#
|
2013-03-06 07:22:17 +01:00
|
|
|
# Copyright (c) 2013 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}
|
2012-05-16 21:08:46 +02:00
|
|
|
%define soname 2_4
|
2013-04-14 10:36:13 +02:00
|
|
|
Version: 2.4.5
|
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++
|
2012-01-04 07:25:38 +01:00
|
|
|
Url: http://%{name}.willowgarage.com/wiki/
|
2013-04-14 10:36:13 +02:00
|
|
|
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/%{version}/%{name}-%{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
|
2012-06-10 23:01:25 +02:00
|
|
|
# PATCH-FIX-UPSTREAM opencv-underlinking.patch koprok@nand.bg -- Make libopencv_highgui.so link to libv4l2 since it's using symbols defined there.
|
|
|
|
Patch2: %{name}-underlinking.patch
|
2010-03-08 18:16:50 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: OpenEXR-devel
|
|
|
|
BuildRequires: cmake
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: dos2unix
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: gstreamer-0_10-plugins-base-devel
|
|
|
|
BuildRequires: libdc1394-devel
|
|
|
|
BuildRequires: libeigen2-devel
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: libjasper-devel
|
2011-08-18 09:52:40 +02:00
|
|
|
BuildRequires: libqt4-devel
|
2011-10-18 14:24:16 +02:00
|
|
|
#BuildRequires: libucil-devel
|
|
|
|
#BuildRequires: libunicap-devel
|
2012-03-20 11:30:49 +01:00
|
|
|
BuildRequires: libilmbase-devel
|
|
|
|
BuildRequires: libjpeg-devel
|
|
|
|
BuildRequires: libtiff-devel
|
2012-05-16 21:08:46 +02:00
|
|
|
BuildRequires: python-devel
|
2011-10-18 14:24:16 +02:00
|
|
|
BuildRequires: python-numpy-devel
|
2012-01-10 14:51:10 +01:00
|
|
|
BuildRequires: zlib-devel
|
2012-09-23 08:08:39 +02:00
|
|
|
BuildRequires: pkgconfig(glu)
|
2010-03-08 18:16:50 +01:00
|
|
|
%if %{with ffmpeg}
|
|
|
|
BuildRequires: libffmpeg-devel
|
|
|
|
%endif
|
2011-07-07 14:28:27 +02:00
|
|
|
BuildRequires: libv4l-devel
|
2013-03-06 07:22:17 +01:00
|
|
|
BuildRequires: python-sphinx
|
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++
|
2010-03-08 18:16:50 +01:00
|
|
|
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}
|
|
|
|
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.
|
|
|
|
|
|
|
|
%package -n %{name}-doc
|
|
|
|
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
|
|
|
|
|
|
|
%description -n %{name}-doc
|
|
|
|
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
|
2012-06-10 23:01:25 +02:00
|
|
|
%patch2 -p1
|
2011-07-07 14:28:27 +02:00
|
|
|
|
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
|
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 \
|
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
|
2011-10-18 14:24:16 +02:00
|
|
|
dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/python*/*.py
|
|
|
|
dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/gpu/*.cpp
|
|
|
|
%fdupes -s %{buildroot}%{_docdir}/%{name}-doc/examples
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
2011-10-18 14:24:16 +02:00
|
|
|
%post -n %{libname}%{soname} -p /sbin/ldconfig
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%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}_*
|
2012-07-22 15:17:05 +02:00
|
|
|
%{_datadir}/OpenCV
|
|
|
|
%exclude %{_datadir}/OpenCV/OpenCVConfig*.cmake
|
2010-03-08 18:16:50 +01:00
|
|
|
|
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
|
2012-07-22 15:17:05 +02:00
|
|
|
%{_datadir}/OpenCV/OpenCVConfig*.cmake
|
2010-03-08 18:16:50 +01:00
|
|
|
|
|
|
|
%files -n python-%{name}
|
|
|
|
%defattr(0644, root, root, 0755)
|
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
|
|
|
|
|
|
|
%files -n %{name}-doc
|
|
|
|
%defattr(-, root, root, 0755)
|
|
|
|
%{_docdir}/%{name}-doc
|
|
|
|
|
|
|
|
%changelog
|