diff --git a/opencv.spec b/opencv.spec index 019412b..17d9cfe 100644 --- a/opencv.spec +++ b/opencv.spec @@ -2,7 +2,7 @@ %define javaver %(echo %version | cut -d. -f1-3 | tr -d .) Name: opencv Version: 2.4.10 -Release: 1mamba +Release: 2mamba Summary: Collection of algorithms for computer vision Group: Development/Libraries Vendor: openmamba @@ -30,7 +30,9 @@ BuildRequires: libfreetype-devel BuildRequires: libgcc BuildRequires: libgdk-pixbuf-devel BuildRequires: libglib-devel +BuildRequires: libgst-plugins-base-devel BuildRequires: libgst-plugins-base010-devel +BuildRequires: libgstreamer-devel BuildRequires: libgstreamer010-devel BuildRequires: libgtk2-devel BuildRequires: libilmbase-devel @@ -52,17 +54,44 @@ BuildRequires: libz-devel ## AUTOBUILDREQ-END BuildRequires: python-Imaging BuildRequires: python-numpy +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-root %description OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. -%package devel -Summary: Devel package for %{name} -Group: Development/Libraries +%package -n lib%{name} +Summary: Collection of algorithms for computer vision +Group: System/Libraries Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} -%description devel +%description -n lib%{name} +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains the OpenCV static libraries. + +%package -n lib%{name}-devel +Summary: Devel package for %{name} +Group: Development/Libraries +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-devel +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains static libraries and header files need for development. + +%package -n lib%{name}-kde4 +Summary: OpenCV libraries build with gstreamer 0.10 for KDE 4 +Group: System/Libraries + +%description -n lib%{name}-kde4 +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains the OpenCV libraries built with gstreamer 0.10 for KDE 4 + +%package -n lib%{name}-kde4-devel +Summary: Devel package for %{name} +Group: Development/Libraries +Requires: lib%{name}-kde4 = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-kde4-devel OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. This package contains static libraries and header files need for development. @@ -88,6 +117,8 @@ This package contains Python bindings for the OpenCV library. %prep %setup -q +#-D -T +#:<< _EOF %ifarch %{ix86} %patch2 -p1 %endif @@ -99,6 +130,7 @@ This package contains Python bindings for the OpenCV library. #% endif %build +#:<< _EOF #-- Interfaces: # -- Use IPP: NO (Intel Performance Primitive) # -- Use TBB: NO (Threading Building Blocks library) @@ -106,7 +138,7 @@ This package contains Python bindings for the OpenCV library. # # append flag -D__STDC_CONSTANT_MACROS to fix build with ffmpeg >= 0.6 PYTHON_PATH=`echo %python27_sitelib | sed "s|%{_prefix}/||"` -%cmake \ +%cmake -d build \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_GSTREAMER=1 \ -DWITH_XINE=1 \ @@ -121,9 +153,28 @@ PYTHON_PATH=`echo %python27_sitelib | sed "s|%{_prefix}/||"` %make_jobs +cd .. + +# Gstreamer 0.10 version for KDE4 (digikam) +%cmake_kde4 -d build_kde4 \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITH_GSTREAMER=0 \ + -DWITH_XINE=1 \ + -DWITH_UNICAP=1 \ + -DWITH_1394=1 \ + -DWITH_FFMPEG=1 \ + -DWITH_QUICKTIME=0 \ + -DBUILD_SWIG_PYTHON_SUPPORT=1 \ + -DINSTALL_C_EXAMPLES=0 \ + -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS -D__STDC_CONSTANT_MACROS" \ + -DPYTHON_PACKAGES_PATH:PATH=$PYTHON_PATH + +%make_jobs + %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -%makeinstall +%makeinstall -C build_kde4 +%makeinstall -C build ## Fix permissions #chmod 0755 %{buildroot}%{python_sitearch}/cv2.so @@ -131,32 +182,42 @@ PYTHON_PATH=`echo %python27_sitelib | sed "s|%{_prefix}/||"` # Remove unpackaged files rm -fr %{buildroot}%{_datadir}/opencv/doc +rm -rf %{buildroot}%{_kde4_sharedir}/OpenCV/java +rm -rf %{buildroot}%{_kde4_bindir} +rm -rf %{buildroot}/opt/kde/lib/python* %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post -n lib%{name} +/sbin/ldconfig +: + +%postun -n lib%{name} +/sbin/ldconfig +: + +%post -n lib%{name}-kde4 +/sbin/ldconfig +: + +%postun -n lib%{name}-kde4 +/sbin/ldconfig +: %files %defattr(-,root,root) %{_bindir}/opencv_* + +%files -n libopencv %{_libdir}/libopencv_*.so.* -#%{_libdir}/libcv.so.* -#%{_libdir}/libcvaux.so.* -#%{_libdir}/libcxcore.so.* -#%{_libdir}/libhighgui.so.* -#%{_libdir}/libml.so.* %dir %{_datadir}/OpenCV %dir %{_datadir}/OpenCV/haarcascades %{_datadir}/OpenCV/haarcascades/* %dir %{_datadir}/OpenCV/lbpcascades %{_datadir}/OpenCV/lbpcascades/* -#%dir %{_datadir}/OpenCV/doc -#%{_datadir}/OpenCV/doc/* -#%doc doc/license.txt -%files devel +%files -n libopencv-devel %defattr(-,root,root) %dir %{_includedir}/opencv %{_includedir}/opencv/* @@ -164,11 +225,11 @@ rm -fr %{buildroot}%{_datadir}/opencv/doc %{_includedir}/opencv2/* %{_libdir}/libopencv_*.so %{_libdir}/libopencv_ts.a -%{_libdir}/pkgconfig/opencv.pc %{_datadir}/OpenCV/OpenCVModules-release.cmake %{_datadir}/OpenCV/OpenCVModules.cmake %{_datadir}/OpenCV/OpenCVConfig.cmake %{_datadir}/OpenCV/OpenCVConfig-version.cmake +%{_libdir}/pkgconfig/opencv.pc %files -n java-opencv %defattr(-,root,root) @@ -176,12 +237,54 @@ rm -fr %{buildroot}%{_datadir}/opencv/doc %{_datadir}/OpenCV/java/libopencv_java%{javaver}.so %{_datadir}/OpenCV/java/opencv-%{javaver}.jar +%ifnarch arm %files -n python-cv %defattr(-,root,root) %{python_sitelib}/cv.py %{python_sitelib}/cv2.so +%endif + +%files -n libopencv-kde4 +%defattr(-,root,root) +%{_kde4_libdir}/libopencv_calib3d.so.* +%{_kde4_libdir}/libopencv_contrib.so.* +%{_kde4_libdir}/libopencv_core.so.* +%{_kde4_libdir}/libopencv_features2d.so.* +%{_kde4_libdir}/libopencv_flann.so.* +%{_kde4_libdir}/libopencv_gpu.so.* +%{_kde4_libdir}/libopencv_highgui.so.* +%{_kde4_libdir}/libopencv_imgproc.so.* +%{_kde4_libdir}/libopencv_legacy.so.* +%{_kde4_libdir}/libopencv_ml.so.* +%{_kde4_libdir}/libopencv_nonfree.so.* +%{_kde4_libdir}/libopencv_objdetect.so.* +%{_kde4_libdir}/libopencv_ocl.so.* +%{_kde4_libdir}/libopencv_photo.so.* +%{_kde4_libdir}/libopencv_stitching.so.* +%{_kde4_libdir}/libopencv_superres.so.* +%{_kde4_libdir}/libopencv_video.so.* +%{_kde4_libdir}/libopencv_videostab.so.* +%dir %{_kde4_sharedir}/OpenCV/ +%dir %{_kde4_sharedir}/OpenCV/haarcascades +%{_kde4_sharedir}/OpenCV/haarcascades/* +%dir %{_kde4_sharedir}/OpenCV/lbpcascades +%{_kde4_sharedir}/OpenCV/lbpcascades/* + +%files -n libopencv-kde4-devel +%defattr(-,root,root) +%dir %{_kde4_includedir}/opencv +%{_kde4_includedir}/opencv/* +%dir %{_kde4_includedir}/opencv2 +%{_kde4_includedir}/opencv2/* +%{_kde4_libdir}/libopencv_*.so +%{_kde4_libdir}/libopencv_ts.a +%{_kde4_sharedir}/OpenCV/*.cmake +%{_kde4_libdir}/pkgconfig/opencv.pc %changelog +* Fri May 29 2015 Silvan Calarco 2.4.10-2mamba +- build kde4 version with gstreamer 0.10 (should fix digikam) + * Sun Dec 28 2014 Automatic Build System 2.4.10-1mamba - automatic version update by autodist