forked from pool/opencv
Accepting request 75617 from KDE:Distro:Factory
Fix compilation with kernel 2.6.38 headers which removed v4l interface. (forwarded request 75616 from namtrac) OBS-URL: https://build.opensuse.org/request/show/75617 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=17
This commit is contained in:
committed by
Git OBS Bridge
parent
8eba5ee96d
commit
390780546f
60
opencv.spec
60
opencv.spec
@@ -23,32 +23,48 @@ Name: opencv
|
||||
%define soname 2_2
|
||||
Version: 2.2.0
|
||||
Release: 1
|
||||
Summary: Collection of algorithms for computer vision
|
||||
Group: Development/Libraries
|
||||
License: BSD3c
|
||||
Summary: Collection of algorithms for computer vision
|
||||
Url: http://%{name}.willowgarage.com/wiki/
|
||||
Group: Development/Libraries
|
||||
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/2.2/OpenCV-%{version}.tar.bz2
|
||||
Patch0: %{name}-2.2-libdir.patch
|
||||
Patch1: %{name}-2.2-samples.patch
|
||||
# PATCH-FIX-UPSTREAM %{name}-2.1-underlinking.patch sf#3083546 reddwarf@opensuse.org -- Link against libv4l2
|
||||
Patch3: %{name}-2.1-underlinking.patch
|
||||
Patch4: %{name}-2.2-gcc46.patch
|
||||
Patch5: %{name}-2.2-zlib.patch
|
||||
# PATCH-FIX-UPSTREAM opencv-v4l-2.6.38.patch idoenmez@suse.de -- Fix libv4l2 support
|
||||
Patch6: opencv-v4l-2.6.38.patch
|
||||
BuildRequires: gstreamer-0_10-plugins-base-devel
|
||||
BuildRequires: pkgconfig(gstreamer-0.10)
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: gstreamer-0_10-devel gstreamer-0_10-plugins-base-devel
|
||||
%if 0%{?suse_version} >= 1110
|
||||
BuildRequires: libdc1394-devel libv4l-devel libxine-devel
|
||||
BuildRequires: libdc1394-devel
|
||||
BuildRequires: libxine-devel
|
||||
%else
|
||||
BuildRequires: xine-devel
|
||||
%endif
|
||||
BuildRequires: OpenEXR-devel gtk2-devel libjasper-devel libjpeg-devel libtiff-devel
|
||||
BuildRequires: cmake gcc-c++ libpng-devel python-devel zlib-devel
|
||||
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
|
||||
BuildRequires: pkgconfig(gtk+-2.0)
|
||||
%if %{with ffmpeg}
|
||||
BuildRequires: libffmpeg-devel
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1130
|
||||
BuildRequires: python-numpy-devel
|
||||
%endif
|
||||
%if 0%{?suse_version} < 1210
|
||||
BuildRequires: libv4l-devel
|
||||
%else
|
||||
BuildRequires: libv4l-devel >= 0.8.4
|
||||
%endif
|
||||
|
||||
%description
|
||||
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C
|
||||
@@ -57,7 +73,6 @@ Computer Vision algorithms.
|
||||
|
||||
%package -n %{libname}%{soname}
|
||||
|
||||
|
||||
Summary: Development files for using the OpenCV library
|
||||
Group: Development/Libraries
|
||||
|
||||
@@ -81,7 +96,6 @@ use the OpenCV library.
|
||||
|
||||
%package -n python-%{name}
|
||||
|
||||
|
||||
Summary: Python bindings for apps which use OpenCV
|
||||
Group: Development/Libraries
|
||||
Requires: python-base
|
||||
@@ -91,7 +105,6 @@ This package contains Python bindings for the OpenCV library.
|
||||
|
||||
%package -n %{name}-doc
|
||||
|
||||
|
||||
Summary: Documentation and examples for OpenCV
|
||||
Group: Documentation
|
||||
# Since this package also contains examples that need -devel to be compiled
|
||||
@@ -107,22 +120,27 @@ This package contains the documentation and examples for the OpenCV library.
|
||||
%patch3
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%patch6 -p1
|
||||
%endif
|
||||
|
||||
# Windows specific and with wrong end of line
|
||||
%{__rm} -f doc/packaging.txt
|
||||
%{__chmod} +x samples/c/build_all.sh
|
||||
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
|
||||
|
||||
%build
|
||||
export CFLAGS=$RPM_OPT_FLAGS
|
||||
export CXXFLAGS=$RPM_OPT_FLAGS
|
||||
%{__mkdir} build
|
||||
export CFLAGS="%{optflags}"
|
||||
export CXXFLAGS="%{optflags}"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_SKIP_RPATH=ON \
|
||||
-DCMAKE_INSTALL_PREFIX='%{_prefix}' \
|
||||
-DLIB_SUFFIX=$(echo %_lib | cut -b4-) \
|
||||
-DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_OMIT_FRAME_POINTER=OFF \
|
||||
-DWITH_XINE=ON \
|
||||
@@ -130,14 +148,14 @@ cmake -DCMAKE_SKIP_RPATH=ON \
|
||||
-DINSTALL_C_EXAMPLES=ON \
|
||||
-DINSTALL_PYTHON_EXAMPLES=ON \
|
||||
..
|
||||
%{__make} %{?jobs:-j %jobs} VERBOSE=1
|
||||
make %{?_smp_mflags} VERBOSE=1
|
||||
|
||||
%install
|
||||
cd build
|
||||
%{__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
|
||||
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
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
Reference in New Issue
Block a user