]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- release 4 (by relup.sh)
[packages/opencv.git] / opencv.spec
1 # TODO:
2 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
3 # - CUDA support (on bcond)
4 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
5 #
6 # Conditional build:
7 # - general options:
8 %bcond_with     tbb             # Threading Building Blocks support (everywhere)
9 %bcond_with     sse             # use SSE instructions
10 %bcond_with     sse2            # use SSE2 instructions
11 %bcond_without  opencl          # OpenCL support
12 %bcond_with     opencl_amdblas  # AMD OpenCL BLAS routines
13 %bcond_with     opencl_amdfft   # AMD OpenCL FFT routines
14 %bcond_without  opengl          # OpenGL support
15 # - bindings
16 %bcond_without  java            # Java binding
17 # - highgui options:
18 %bcond_without  ffmpeg          # FFMpeg support in highgui
19 %bcond_without  gstreamer       # GStreamer support in highgui
20 %bcond_with     openni          # OpenNI (Natural Interaction) support in highgui
21 %bcond_with     pvapi           # PvAPI (AVT GigE cameras) support in highgui (proprietary)
22 %bcond_with     qt              # Qt backend instead of GTK+ in highgui
23 %bcond_with     unicap          # Unicap support in highgui (GPL)
24 %bcond_with     v4l             # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
25 %bcond_with     ximea           # m3API (XIMEA cameras) support in highgui (proprietary)
26 %bcond_with     xine            # XINE support in highgui (GPL)
27
28 %ifarch pentium3 pentium4 %{x8664}
29 %define         with_sse        1
30 %endif
31 %ifarch pentium4 %{x8664}
32 %define         with_sse2       1
33 %endif
34 Summary:        A library of programming functions mainly aimed at real time computer vision
35 Summary(pl.UTF-8):      Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
36 Name:           opencv
37 Version:        2.4.6.2
38 Release:        4
39 Epoch:          1
40 %if %{with unicap} || %{with xine}
41 License:        GPL (enforced by used libraries), BSD (opencv itself)
42 %else
43 License:        BSD
44 %endif
45 Group:          Libraries
46 Source0:        https://github.com/Itseez/opencv/archive/%{version}.tar.gz
47 # Source0-md5:  b9cb3420fa715c2e23f012d42a9b0988
48 Patch0:         %{name}-cflags.patch
49 Patch1:         %{name}-link.patch
50 Patch2:         %{name}-unicap-c++.patch
51 Patch3:         %{name}-c.patch
52 Patch4:         %{name}-gcc.patch
53 Patch5:         %{name}-ximea.patch
54 Patch6:         %{name}-ocl-fft.patch
55 Patch7:         java-ant-sourcelevel.patch
56 URL:            http://opencv.willowgarage.com/
57 %{?with_pvapi:BuildRequires:    AVT_GigE_SDK-devel}
58 %{?with_opencl:BuildRequires:   OpenCL-devel}
59 BuildRequires:  OpenEXR-devel
60 %{?with_opengl:BuildRequires:   OpenGL-GLU-devel}
61 %{?with_opengl:BuildRequires:   OpenGL-devel}
62 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
63 %{?with_openni:BuildRequires:   OpenNI-devel}
64 %{?with_ximea:BuildRequires:    XIMEA-devel}
65 %{?with_java:BuildRequires:     ant}
66 %{?with_opencl_amdblas:BuildRequires:   clAmdBlas-devel}
67 %{?with_opencl_amdfft:BuildRequires:    clAmdFft-devel}
68 BuildRequires:  cmake >= 2.8
69 BuildRequires:  doxygen
70 BuildRequires:  eigen3 >= 3
71 %{?with_ffmpeg:BuildRequires:   ffmpeg-devel >= 0.7}
72 %if %{with gstreamer}
73 BuildRequires:  gstreamer-devel >= 0.10
74 BuildRequires:  gstreamer-plugins-base-devel >= 0.10
75 %endif
76 BuildRequires:  jasper-devel
77 %{?with_java:BuildRequires:     jdk}
78 BuildRequires:  libdc1394-devel
79 BuildRequires:  libjpeg-devel
80 BuildRequires:  libpng-devel
81 BuildRequires:  libraw1394-devel
82 BuildRequires:  libstdc++-devel
83 BuildRequires:  libtiff-devel
84 BuildRequires:  libtool
85 %if %{with unicap}
86 BuildRequires:  libucil-devel
87 BuildRequires:  libunicap-devel
88 %endif
89 BuildRequires:  libv4l-devel
90 BuildRequires:  pkgconfig
91 BuildRequires:  python
92 BuildRequires:  python-devel
93 BuildRequires:  python-numpy-devel
94 BuildRequires:  rpm-pythonprov
95 BuildRequires:  rpmbuild(macros) >= 1.606
96 BuildRequires:  sed >= 4.0
97 BuildRequires:  swig-python
98 %{?with_tbb:BuildRequires:      tbb-devel}
99 %{?with_xine:BuildRequires:     xine-lib-devel}
100 BuildRequires:  zlib-devel
101 %if %{with qt}
102 BuildRequires:  QtCore-devel >= 4
103 BuildRequires:  QtGui-devel >= 4
104 %{?with_opengl:BuildRequires:   QtOpenGL-devel >= 4}
105 BuildRequires:  qt4-qmake >= 4
106 %else
107 BuildRequires:  gtk+2-devel >= 2.0
108 %{?with_opengl:BuildRequires:   gtkglext-devel >= 1.0}
109 %endif
110 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
111
112 %define         sover   %(v=%{version}; k=${v#?.?.?}; echo ${v%$k})
113
114 # build broken, can't find g++
115 %undefine       with_ccache
116
117 %description
118 OpenCV (Open Source Computer Vision) is a library of programming
119 functions mainly aimed at real time computer vision.
120
121 Example applications of the OpenCV library are:
122 - Human-Computer Interaction (HCI)
123 - Object Identification, Segmentation and Recognition
124 - Face Recognition
125 - Gesture Recognition
126 - Motion Tracking
127 - Ego Motion, Motion Understanding
128 - Structure From Motion (SFM)
129 - Stereo and Multi-Camera Calibration and Depth Computation
130 - Mobile Robotics.
131
132 %description -l pl.UTF-8
133 OpenCV (Open Source Computer Vision) to biblioteka funkcji
134 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
135
136 Przykładowe zastosowania biblioteki OpenCV to
137 - interakcje człowiek-komputer (HCI)
138 - identyfikacja, segmentacja i rozpoznawanie obiektów
139 - rozpoznawanie twarzy
140 - rozpoznawanie gestów
141 - śledzenie ruchu
142 - rozumienie ruchu
143 - SFM (Structure From Motion)
144 - kalibracja dwu- i wielokamerowa, obliczanie głębi
145 - robotyka ruchu.
146
147 %package core
148 Summary:        OpenCV core libraries
149 Group:          Libraries
150 Conflicts:      %{name} < 2.4.6.2-1
151
152 %description core
153 This package contains the OpenCV C/C++ core libraries.
154
155 %package devel
156 Summary:        Header files for OpenCV library
157 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
158 Group:          Development/Libraries
159 Requires:       %{name} = %{epoch}:%{version}-%{release}
160 Obsoletes:      opencv-static
161
162 %description devel
163 Header files for OpenCV library.
164
165 %description devel -l pl.UTF-8
166 Pliki nagłówkowe biblioteki OpenCV.
167
168 %package doc
169 Summary:        Manual for OpenCV
170 Summary(fr.UTF-8):      Documentation pour OpenCV
171 Summary(it.UTF-8):      Documentazione di OpenCV
172 Summary(pl.UTF-8):      Podręcznik dla OpenCV
173 Group:          Documentation
174 # noarch subpackages only when building with rpm5
175 %if "%{_rpmversion}" >= "5"
176 BuildArch:      noarch
177 %endif
178
179 %description doc
180 Documentation for OpenCV.
181
182 %description doc -l fr.UTF-8
183 Documentation pour OpenCV.
184
185 %description doc -l it.UTF-8
186 Documentazione di OpenCV.
187
188 %description doc -l pl.UTF-8
189 Dokumentacja do OpenCV.
190
191 %package -n java-opencv
192 Summary:        OpenCV Java bindings
193 Summary(pl.UTF-8):      Wiązania Javy do OpenCV
194 Group:          Libraries/Java
195 Requires:       %{name} = %{epoch}:%{version}-%{release}
196 Requires:       jre
197
198 %description -n java-opencv
199 OpenCV Java bindings.
200
201 %description -n java-opencv -l pl.UTF-8
202 Wiązania Javy do OpenCV.
203
204 %package -n python-opencv
205 Summary:        OpenCV Python bindings
206 Summary(pl.UTF-8):      Wiązania Pythona do OpenCV
207 Group:          Libraries/Python
208 Requires:       %{name} = %{epoch}:%{version}-%{release}
209 Requires:       python-libs
210
211 %description -n python-opencv
212 OpenCV Python bindings.
213
214 %description -n python-opencv -l pl.UTF-8
215 Wiązania Pythona do OpenCV.
216
217 %prep
218 %setup -q
219
220 %undos CMakeLists.txt
221 %undos modules/gpu/CMakeLists.txt
222
223 %patch0 -p1
224 %patch1 -p1
225 %patch2 -p1
226 %patch3 -p1
227 %patch4 -p1
228 %patch5 -p1
229 %patch6 -p1
230 %patch7 -p1
231
232 %build
233 install -d build
234 cd build
235 %cmake .. \
236         -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
237         -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
238         -DBUILD_NEW_PYTHON_SUPPORT=ON \
239         -DUSE_O3=OFF \
240         %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
241         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
242         %{?with_opencl:-DWITH_OPENCL=ON} \
243         %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \
244         %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \
245         %{?with_opengl:-DWITH_OPENGL=ON} \
246         %{?with_openni:-DWITH_OPENNI=ON} \
247         %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
248         %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
249         %{?with_tbb:-DWITH_TBB=ON} \
250         %{?with_unicap:-DWITH_UNICAP=ON} \
251         %{!?with_v4l:-DWITH_V4L=OFF} \
252         %{?with_ximea:-DWITH_XIMEA=ON} \
253         %{?with_xine:-DWITH_XINE=ON}
254
255 %{__make}
256
257 %install
258 rm -rf $RPM_BUILD_ROOT
259 %{__make} -C build install \
260         DESTDIR=$RPM_BUILD_ROOT
261
262 # see -doc package
263 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/OpenCV/doc
264
265 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
266 cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
267
268 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
269 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
270 %py_postclean
271
272 %if %{with java}
273 # move to proper directories, create symlink
274 install -d $RPM_BUILD_ROOT%{_javadir}
275 %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
276 %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
277 rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
278 ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
279 %endif
280
281 %clean
282 rm -rf $RPM_BUILD_ROOT
283
284 %post   -p /sbin/ldconfig
285 %postun -p /sbin/ldconfig
286
287 %post   core -p /sbin/ldconfig
288 %postun core -p /sbin/ldconfig
289
290 %post   -n java-opencv -p /sbin/ldconfig
291 %postun -n java-opencv -p /sbin/ldconfig
292
293 %files
294 %defattr(644,root,root,755)
295 %attr(755,root,root) %{_bindir}/opencv_createsamples
296 %attr(755,root,root) %{_bindir}/opencv_haartraining
297 %attr(755,root,root) %{_bindir}/opencv_performance
298 %attr(755,root,root) %{_bindir}/opencv_traincascade
299 %attr(755,root,root) %{_libdir}/libopencv_calib3d.so.%{sover}
300 %ghost %{_libdir}/libopencv_calib3d.so.2.4
301 %attr(755,root,root) %{_libdir}/libopencv_contrib.so.%{sover}
302 %ghost %{_libdir}/libopencv_contrib.so.2.4
303 %attr(755,root,root) %{_libdir}/libopencv_features2d.so.%{sover}
304 %ghost %{_libdir}/libopencv_features2d.so.2.4
305 %attr(755,root,root) %{_libdir}/libopencv_highgui.so.%{sover}
306 %ghost %{_libdir}/libopencv_highgui.so.2.4
307 %attr(755,root,root) %{_libdir}/libopencv_legacy.so.%{sover}
308 %ghost %{_libdir}/libopencv_legacy.so.2.4
309 %attr(755,root,root) %{_libdir}/libopencv_objdetect.so.%{sover}
310 %ghost %{_libdir}/libopencv_objdetect.so.2.4
311 %attr(755,root,root) %{_libdir}/libopencv_stitching.so.%{sover}
312 %ghost %{_libdir}/libopencv_stitching.so.2.4
313 %attr(755,root,root) %{_libdir}/libopencv_ts.so.%{sover}
314 %ghost %{_libdir}/libopencv_ts.so.2.4
315 %attr(755,root,root) %{_libdir}/libopencv_superres.so.%{sover}
316 %ghost %{_libdir}/libopencv_superres.so.2.4
317 %attr(755,root,root) %{_libdir}/libopencv_videostab.so.%{sover}
318 %ghost %{_libdir}/libopencv_videostab.so.2.4
319 %attr(755,root,root) %{_libdir}/libopencv_gpu.so.%{sover}
320 %ghost %{_libdir}/libopencv_gpu.so.2.4
321 %attr(755,root,root) %{_libdir}/libopencv_nonfree.so.%{sover}
322 %ghost %{_libdir}/libopencv_nonfree.so.2.4
323 %dir %{_datadir}/OpenCV
324 %{_datadir}/OpenCV/haarcascades
325 %{_datadir}/OpenCV/lbpcascades
326
327 %files core
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_libdir}/libopencv_core.so.%{sover}
330 %ghost %{_libdir}/libopencv_core.so.2.4
331 %attr(755,root,root) %{_libdir}/libopencv_flann.so.%{sover}
332 %ghost %{_libdir}/libopencv_flann.so.2.4
333 %attr(755,root,root) %{_libdir}/libopencv_imgproc.so.%{sover}
334 %ghost %{_libdir}/libopencv_imgproc.so.2.4
335 %attr(755,root,root) %{_libdir}/libopencv_ml.so.%{sover}
336 %ghost %{_libdir}/libopencv_ml.so.2.4
337 %attr(755,root,root) %{_libdir}/libopencv_photo.so.%{sover}
338 %ghost %{_libdir}/libopencv_photo.so.2.4
339 %attr(755,root,root) %{_libdir}/libopencv_video.so.%{sover}
340 %ghost %{_libdir}/libopencv_video.so.2.4
341
342 %files devel
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{_libdir}/libopencv_*.so
345 %if %{with java}
346 %exclude %{_libdir}/libopencv_java246.so
347 %endif
348 %{_includedir}/opencv
349 %{_includedir}/opencv2
350 %{_datadir}/OpenCV/OpenCVConfig*.cmake
351 %{_pkgconfigdir}/opencv.pc
352
353 %files doc
354 %defattr(644,root,root,755)
355 # TODO: probably could rebuild them and package via make install
356 %doc doc/*
357
358 %if %{with java}
359 %files -n java-opencv
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_libdir}/libopencv_java246.so
362 %{_javadir}/opencv-246.jar
363 %{_javadir}/opencv.jar
364 %endif
365
366 %files -n python-opencv
367 %defattr(644,root,root,755)
368 %attr(755,root,root) %{py_sitedir}/cv2.so
369 %{py_sitedir}/cv.py[co]
This page took 0.078431 seconds and 4 git commands to generate.