]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- added OpenCL support
[packages/opencv.git] / opencv.spec
1 #
2 # TODO:
3 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ ?)
4 # - finish AMD OpenCL routines support
5 # - CUDA support (on bcond)
6 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
7 #
8 # Conditional build:
9 # - general options:
10 %bcond_with     tbb             # Threading Building Blocks support (everywhere)
11 %bcond_with     sse             # use SSE instructions
12 %bcond_with     sse2            # use SSE2 instructions
13 %bcond_without  opencl          # OpenCL support
14 %bcond_with     opencl_amdblas  # AMD OpenCL BLAS routines
15 %bcond_with     opencl_amdfft   # AMD OpenCL FFT routines
16 %bcond_without  opengl          # OpenGL support
17 # - highgui options:
18 %bcond_without  gstreamer       # GStreamer support in highgui
19 %bcond_with     openni          # OpenNI (Natural Interaction) support in highgui
20 %bcond_with     pvapi           # PvAPI (AVT GigE cameras) support in highgui (proprietary)
21 %bcond_with     qt              # Qt backend instead of GTK+ in highgui
22 %bcond_with     unicap          # Unicap support in highgui (GPL)
23 %bcond_with     v4l             # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
24 %bcond_with     ximea           # m3API (XIMEA cameras) support in highgui (proprietary)
25 %bcond_with     xine            # XINE support in highgui (GPL)
26 #
27 %ifarch pentium3 pentium4 %{x8664}
28 %define         with_sse        1
29 %endif
30 %ifarch pentium4 %{x8664}
31 %define         with_sse2       1
32 %endif
33 Summary:        A library of programming functions mainly aimed at real time computer vision
34 Summary(pl.UTF-8):      Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
35 Name:           opencv
36 Version:        2.4.3
37 Release:        1
38 Epoch:          1
39 %if %{with unicap} || %{with xine}
40 License:        GPL (enforced by used libraries), BSD (opencv itself)
41 %else
42 License:        BSD
43 %endif
44 Group:          Libraries
45 Source0:        http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2
46 # Source0-md5:  c0a5af4ff9d0d540684c0bf00ef35dbe
47 Patch0:         %{name}-cflags.patch
48 Patch1:         %{name}-link.patch
49 Patch2:         %{name}-unicap-c++.patch
50 Patch3:         %{name}-c.patch
51 Patch4:         %{name}-gcc.patch
52 Patch5:         %{name}-ximea.patch
53 URL:            http://opencv.willowgarage.com/
54 %{?with_pvapi:BuildRequires:    AVT_GigE_SDK-devel}
55 %{?with_opencl:BuildRequires:   OpenCL-devel}
56 BuildRequires:  OpenEXR-devel
57 %{?with_opengl:BuildRequires:   OpenGL-devel}
58 %{?with_opengl:BuildRequires:   OpenGL-GLU-devel}
59 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
60 %{?with_openni:BuildRequires:   OpenNI-devel}
61 %{?with_ximea:BuildRequires:    XIMEA-devel}
62 BuildRequires:  cmake >= 2.4
63 BuildRequires:  doxygen
64 BuildRequires:  eigen3 >= 3
65 BuildRequires:  ffmpeg-devel >= 0.7
66 %if %{with gstreamer}
67 BuildRequires:  gstreamer-devel >= 0.10
68 BuildRequires:  gstreamer-plugins-base-devel >= 0.10
69 %endif
70 BuildRequires:  jasper-devel
71 BuildRequires:  libdc1394-devel
72 BuildRequires:  libjpeg-devel
73 BuildRequires:  libpng-devel
74 BuildRequires:  libraw1394-devel
75 BuildRequires:  libstdc++-devel
76 BuildRequires:  libtiff-devel
77 BuildRequires:  libtool
78 %if %{with unicap}
79 BuildRequires:  libucil-devel
80 BuildRequires:  libunicap-devel
81 %endif
82 BuildRequires:  libv4l-devel
83 BuildRequires:  pkgconfig
84 BuildRequires:  python-devel
85 BuildRequires:  python-numpy-devel
86 BuildRequires:  rpm-pythonprov
87 BuildRequires:  rpmbuild(macros) >= 1.606
88 BuildRequires:  sed >= 4.0
89 BuildRequires:  swig-python
90 %{?with_tbb:BuildRequires:      tbb-devel}
91 %{?with_xine:BuildRequires:     xine-lib-devel}
92 BuildRequires:  zlib-devel
93 %if %{with qt}
94 BuildRequires:  QtCore-devel >= 4
95 BuildRequires:  QtGui-devel >= 4
96 %{?with_opengl:BuildRequires:   QtOpenGL-devel >= 4}
97 BuildRequires:  qt4-qmake >= 4
98 %else
99 BuildRequires:  gtk+2-devel >= 2.0
100 %{?with_opengl:BuildRequires:   gtkglext-devel >= 1.0}
101 %endif
102 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104 %description
105 OpenCV (Open Source Computer Vision) is a library of programming
106 functions mainly aimed at real time computer vision.
107
108 Example applications of the OpenCV library are:
109 - Human-Computer Interaction (HCI)
110 - Object Identification, Segmentation and Recognition
111 - Face Recognition
112 - Gesture Recognition
113 - Motion Tracking
114 - Ego Motion, Motion Understanding
115 - Structure From Motion (SFM)
116 - Stereo and Multi-Camera Calibration and Depth Computation
117 - Mobile Robotics.
118
119 %description -l pl.UTF-8
120 OpenCV (Open Source Computer Vision) to biblioteka funkcji
121 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
122
123 Przykładowe zastosowania biblioteki OpenCV to
124 - interakcje człowiek-komputer (HCI)
125 - identyfikacja, segmentacja i rozpoznawanie obiektów
126 - rozpoznawanie twarzy
127 - rozpoznawanie gestów
128 - śledzenie ruchu
129 - rozumienie ruchu
130 - SFM (Structure From Motion)
131 - kalibracja dwu- i wielokamerowa, obliczanie głębi
132 - robotyka ruchu.
133
134 %package devel
135 Summary:        Header files for OpenCV library
136 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
137 Group:          Development/Libraries
138 Requires:       %{name} = %{epoch}:%{version}-%{release}
139 Obsoletes:      opencv-static
140
141 %description devel
142 Header files for OpenCV library.
143
144 %description devel -l pl.UTF-8
145 Pliki nagłówkowe biblioteki OpenCV.
146
147 %package -n python-opencv
148 Summary:        OpenCV Python bindings
149 Summary(pl.UTF-8):      Wiązania Pythona do OpenCV
150 Group:          Libraries/Python
151 Requires:       %{name} = %{epoch}:%{version}-%{release}
152 %pyrequires_eq  python-libs
153
154 %description -n python-opencv
155 OpenCV Python bindings.
156
157 %description -n python-opencv -l pl.UTF-8
158 Wiązania Pythona do OpenCV.
159
160 %prep
161 %setup -q -n OpenCV-%{version}
162
163 %undos CMakeLists.txt
164 %undos modules/gpu/CMakeLists.txt
165
166 %patch0 -p1
167 %patch1 -p1
168 %patch2 -p1
169 %patch3 -p1
170 %patch4 -p1
171 %patch5 -p1
172
173 %build
174 install -d build
175 cd build
176 %cmake .. \
177         -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
178         -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
179         -DBUILD_NEW_PYTHON_SUPPORT=ON \
180         -DUSE_O3=OFF \
181         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
182         %{?with_opencl:-DWITH_OPENCL=ON} \
183         %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
184         %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
185         %{?with_opengl:-DWITH_OPENGL=ON} \
186         %{?with_openni:-DWITH_OPENNI=ON} \
187         %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
188         %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
189         %{?with_tbb:-DWITH_TBB=ON} \
190         %{?with_unicap:-DWITH_UNICAP=ON} \
191         %{!?with_v4l:-DWITH_V4L=OFF} \
192         %{?with_ximea:-DWITH_XIMEA=ON} \
193         %{?with_xine:-DWITH_XINE=ON}
194
195 %{__make}
196
197 %install
198 rm -rf $RPM_BUILD_ROOT
199
200 %{__make} -C build install \
201         DESTDIR=$RPM_BUILD_ROOT
202
203 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
204 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
205
206 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
207 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
208 %py_postclean
209
210 %clean
211 rm -rf $RPM_BUILD_ROOT
212
213 %post   -p /sbin/ldconfig
214 %postun -p /sbin/ldconfig
215
216 %files
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_bindir}/opencv_*
219 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
220 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
221 %dir %{_datadir}/OpenCV
222 %doc %{_datadir}/OpenCV/doc
223 %{_datadir}/OpenCV/haarcascades
224 %{_datadir}/OpenCV/lbpcascades
225
226 %files devel
227 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_libdir}/libopencv_*.so
229 %{_includedir}/opencv
230 %{_includedir}/opencv2
231 %{_datadir}/OpenCV/OpenCVConfig*.cmake
232 %{_pkgconfigdir}/opencv.pc
233
234 %files -n python-opencv
235 %defattr(644,root,root,755)
236 %attr(755,root,root) %{py_sitedir}/cv2.so
237 %{py_sitedir}/cv.py[co]
This page took 0.093406 seconds and 4 git commands to generate.