Accepting request 185439 from KDE:Distro:Factory

Forward

OBS-URL: https://build.opensuse.org/request/show/185439
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=44
This commit is contained in:
Stephan Kulow 2013-08-01 13:56:40 +00:00 committed by Git OBS Bridge
parent dc5873b4ca
commit 6ca799f387
2 changed files with 59 additions and 45 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Jul 14 16:54:56 UTC 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 11:22:31 EEST 2013 - koprok@nand.bg

View File

@ -18,44 +18,53 @@
%bcond_with ffmpeg
Name: opencv
%define libname lib%{name}
%define soname 2_4
%define soname 2_4
Name: opencv
Version: 2.4.6.1
Release: 0
Summary: Collection of algorithms for computer vision
License: BSD-3-Clause
Group: Development/Libraries/C and C++
Url: http://%{name}.willowgarage.com/wiki/
Url: http://opencv.org/
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM opencv-samples.patch koprok@nand.bg -- Improve samples installation.
Patch1: %{name}-samples.patch
# 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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: OpenEXR-devel
BuildRequires: cmake
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: gstreamer-0_10-plugins-base-devel
BuildRequires: libdc1394-devel
%if 0%{?suse_version} > 1230
BuildRequires: libeigen3-devel
%else
BuildRequires: libeigen2-devel
BuildRequires: libjasper-devel
BuildRequires: libqt4-devel
#BuildRequires: libucil-devel
#BuildRequires: libunicap-devel
BuildRequires: libilmbase-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: zlib-devel
BuildRequires: pkgconfig(glu)
%endif
%if %{with ffmpeg}
BuildRequires: libffmpeg-devel
%endif
BuildRequires: libjasper-devel
BuildRequires: libjpeg-devel
BuildRequires: libqt4-devel
BuildRequires: libtiff-devel
BuildRequires: libucil-devel
BuildRequires: libunicap-devel
BuildRequires: libv4l-devel
%if 0%{?suse_version} > 1220
BuildRequires: ilmbase-devel
BuildRequires: openexr-devel
%else
BuildRequires: OpenEXR-devel
BuildRequires: libilmbase-devel
%endif
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
@ -91,14 +100,14 @@ Requires: python-base = %{py_ver}
%description -n python-%{name}
This package contains Python bindings for the OpenCV library.
%package -n %{name}-doc
%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 -n %{name}-doc
%description doc
This package contains the documentation and examples for the OpenCV library.
%prep
@ -106,13 +115,10 @@ This package contains the documentation and examples for the OpenCV library.
%patch1 -p1
%patch2 -p1
# Windows specific and with wrong end of line
# Remove Windows specific files
rm -f doc/packaging.txt
chmod +x samples/c/build_all.sh
sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
samples/c/latentsvmdetect.cpp \
samples/gpu/hog.cpp \
samples/python/camshift.py
# Fix "wrong-file-end-of-line-encoding" rpmlint warning
sed -i 's/\r$//' samples/c/facedetect.cmd
%build
export CFLAGS="%{optflags} $(getconf LFS_CFLAGS)"
@ -145,42 +151,43 @@ 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
dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/python*/*.py
dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/gpu/*.cpp
# 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}
%clean
rm -rf %{buildroot}
%post -n %{libname}%{soname} -p /sbin/ldconfig
%post -n %{libname}%{soname} -p /sbin/ldconfig
%postun -n %{libname}%{soname} -p /sbin/ldconfig
%files -n %{libname}%{soname}
%defattr(-, root, root, 0755)
%{_libdir}/lib*.so.*
%files -n %{name}
%defattr(0644, root, root, 0755)
%attr(0755, root, root) %{_bindir}/%{name}_*
%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(0644, root, root, 0755)
%{_includedir}/opencv
%{_includedir}/opencv2
%defattr(-,root,root,-)
%{_includedir}/opencv/
%{_includedir}/opencv2/
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/OpenCV/OpenCVConfig*.cmake
%files -n python-%{name}
%defattr(0644, root, root, 0755)
%defattr(-,root,root,-)
%{python_sitearch}/cv.py
%{python_sitearch}/cv2.so
%files -n %{name}-doc
%defattr(-, root, root, 0755)
%{_docdir}/%{name}-doc
%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}-doc/
%changelog