]> git.pld-linux.org Git - packages/opencv.git/blobdiff - opencv.spec
bootstrap build without ffmpeg
[packages/opencv.git] / opencv.spec
index 9ff0c0ad51f688868ba895f6e09cd7c37310d241..443ecd35feabf5d265501ff356698bfcd76325cb 100644 (file)
@@ -1,13 +1,22 @@
 #
 # TODO:
+# - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
 # - CUDA support (on bcond)
+# - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
 #
 # Conditional build:
 # - general options:
 %bcond_with    tbb             # Threading Building Blocks support (everywhere)
 %bcond_with    sse             # use SSE instructions
 %bcond_with    sse2            # use SSE2 instructions
+%bcond_without opencl          # OpenCL support
+%bcond_with    opencl_amdblas  # AMD OpenCL BLAS routines
+%bcond_with    opencl_amdfft   # AMD OpenCL FFT routines
+%bcond_without opengl          # OpenGL support
+# - bindings
+%bcond_without java            # Java binding
 # - highgui options:
+%bcond_without ffmpeg          # FFMpeg support in highgui
 %bcond_without gstreamer       # GStreamer support in highgui
 %bcond_with    openni          # OpenNI (Natural Interaction) support in highgui
 %bcond_with    pvapi           # PvAPI (AVT GigE cameras) support in highgui (proprietary)
@@ -16,7 +25,7 @@
 %bcond_with    v4l             # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
 %bcond_with    ximea           # m3API (XIMEA cameras) support in highgui (proprietary)
 %bcond_with    xine            # XINE support in highgui (GPL)
-#
+
 %ifarch pentium3 pentium4 %{x8664}
 %define                with_sse        1
 %endif
@@ -26,8 +35,8 @@
 Summary:       A library of programming functions mainly aimed at real time computer vision
 Summary(pl.UTF-8):     Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
 Name:          opencv
-Version:       2.3.1
-Release:       9
+Version:       2.4.5
+Release:       3.1
 Epoch:         1
 %if %{with unicap} || %{with xine}
 License:       GPL (enforced by used libraries), BSD (opencv itself)
@@ -35,30 +44,38 @@ License:    GPL (enforced by used libraries), BSD (opencv itself)
 License:       BSD
 %endif
 Group:         Libraries
-Source0:       http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}a.tar.bz2
-# Source0-md5: 82e4b6bfa349777233eea09b075e931e
+Source0:       http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz
+# Source0-md5: 8eac87462c7bec8b89021b723207c623
 Patch0:                %{name}-cflags.patch
 Patch1:                %{name}-link.patch
 Patch2:                %{name}-unicap-c++.patch
 Patch3:                %{name}-c.patch
 Patch4:                %{name}-gcc.patch
-Patch5:                %{name}-multilib.patch
-Patch6:                %{name}-ximea-linux.patch
+Patch5:                %{name}-ximea.patch
+Patch6:                %{name}-ocl-fft.patch
+Patch7:                java-ant-sourcelevel.patch
 URL:           http://opencv.willowgarage.com/
 %{?with_pvapi:BuildRequires:   AVT_GigE_SDK-devel}
+%{?with_opencl:BuildRequires:  OpenCL-devel}
 BuildRequires: OpenEXR-devel
-# as of OpenCV 2.3.1 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
+%{?with_opengl:BuildRequires:  OpenGL-devel}
+%{?with_opengl:BuildRequires:  OpenGL-GLU-devel}
+# as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
 %{?with_openni:BuildRequires:  OpenNI-devel}
 %{?with_ximea:BuildRequires:   XIMEA-devel}
-BuildRequires: cmake >= 2.4
+%{?with_java:BuildRequires:    ant}
+%{?with_opencl_amdblas:BuildRequires:  clAmdBlas-devel}
+%{?with_opencl_amdfft:BuildRequires:   clAmdFft-devel}
+BuildRequires: cmake >= 2.8
 BuildRequires: doxygen
-BuildRequires: eigen >= 2
-BuildRequires: ffmpeg-devel >= 0.7
+BuildRequires: eigen3 >= 3
+%{?with_ffmpeg:BuildRequires:  ffmpeg-devel >= 0.7}
 %if %{with gstreamer}
 BuildRequires: gstreamer-devel >= 0.10
 BuildRequires: gstreamer-plugins-base-devel >= 0.10
 %endif
 BuildRequires: jasper-devel
+%{?with_java:BuildRequires:    jdk}
 BuildRequires: libdc1394-devel
 BuildRequires: libjpeg-devel
 BuildRequires: libpng-devel
@@ -72,6 +89,7 @@ BuildRequires:        libunicap-devel
 %endif
 BuildRequires: libv4l-devel
 BuildRequires: pkgconfig
+BuildRequires: python
 BuildRequires: python-devel
 BuildRequires: python-numpy-devel
 BuildRequires: rpm-pythonprov
@@ -82,17 +100,19 @@ BuildRequires:     swig-python
 %{?with_xine:BuildRequires:    xine-lib-devel}
 BuildRequires: zlib-devel
 %if %{with qt}
-BuildRequires: OpenGL-devel
 BuildRequires: QtCore-devel >= 4
 BuildRequires: QtGui-devel >= 4
-BuildRequires: QtOpenGL-devel >= 4
+%{?with_opengl:BuildRequires:  QtOpenGL-devel >= 4}
 BuildRequires: qt4-qmake >= 4
 %else
 BuildRequires: gtk+2-devel >= 2.0
+%{?with_opengl:BuildRequires:  gtkglext-devel >= 1.0}
 %endif
-# ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# build broken, can't find g++
+%undefine      with_ccache
+
 %description
 OpenCV (Open Source Computer Vision) is a library of programming
 functions mainly aimed at real time computer vision.
@@ -136,6 +156,19 @@ Header files for OpenCV library.
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki OpenCV.
 
+%package -n java-opencv
+Summary:       OpenCV Java bindings
+Summary(pl.UTF-8):     Wiązania Javy do OpenCV
+Group:         Libraries/Java
+Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires:      jre
+
+%description -n java-opencv
+OpenCV Java bindings.
+
+%description -n java-opencv -l pl.UTF-8
+Wiązania Javy do OpenCV.
+
 %package -n python-opencv
 Summary:       OpenCV Python bindings
 Summary(pl.UTF-8):     Wiązania Pythona do OpenCV
@@ -150,7 +183,7 @@ OpenCV Python bindings.
 Wiązania Pythona do OpenCV.
 
 %prep
-%setup -q -n OpenCV-%{version}
+%setup -q
 
 %undos CMakeLists.txt
 %undos modules/gpu/CMakeLists.txt
@@ -162,6 +195,7 @@ Wiązania Pythona do OpenCV.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 install -d build
@@ -171,10 +205,15 @@ cd build
        -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
        -DBUILD_NEW_PYTHON_SUPPORT=ON \
        -DUSE_O3=OFF \
+       %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
        %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
+       %{?with_opencl:-DWITH_OPENCL=ON} \
+       %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \
+       %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \
+       %{?with_opengl:-DWITH_OPENGL=ON} \
        %{?with_openni:-DWITH_OPENNI=ON} \
-       %{!?with_pvapi:-DWITH_PVAPI=OFF} \
-       %{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
+       %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
+       %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
        %{?with_tbb:-DWITH_TBB=ON} \
        %{?with_unicap:-DWITH_UNICAP=ON} \
        %{!?with_v4l:-DWITH_V4L=OFF} \
@@ -185,28 +224,39 @@ cd build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 %{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
-install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
+cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
 
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 
+%if %{with java}
+# move to proper directories, create symlink
+install -d $RPM_BUILD_ROOT%{_javadir}
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
+rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
+ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post   -p /sbin/ldconfig
 %postun -p /sbin/ldconfig
 
+%post   -n java-opencv -p /sbin/ldconfig
+%postun -n java-opencv -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/opencv_*
 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.3
+%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
 %dir %{_datadir}/OpenCV
 %doc %{_datadir}/OpenCV/doc
 %{_datadir}/OpenCV/haarcascades
@@ -215,11 +265,22 @@ rm -rf $RPM_BUILD_ROOT
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libopencv_*.so
+%if %{with java}
+%exclude %{_libdir}/libopencv_java245.so
+%endif
 %{_includedir}/opencv
 %{_includedir}/opencv2
 %{_datadir}/OpenCV/OpenCVConfig*.cmake
 %{_pkgconfigdir}/opencv.pc
 
+%if %{with java}
+%files -n java-opencv
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libopencv_java245.so
+%{_javadir}/opencv-245.jar
+%{_javadir}/opencv.jar
+%endif
+
 %files -n python-opencv
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py_sitedir}/cv2.so
This page took 0.3809 seconds and 4 git commands to generate.