]> git.pld-linux.org Git - packages/opencv.git/blame - opencv.spec
- release 4 (by relup.sh)
[packages/opencv.git] / opencv.spec
CommitLineData
8d499a62 1# TODO:
2acd8ac1 2# - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
8d499a62 3# - CUDA support (on bcond)
5df3cf1b 4# - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
a8d52c2e 5#
0c2d6b7d 6# Conditional build:
a55ba198
JB
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
8d5385eb
JB
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
b07433c6
JB
15# - bindings
16%bcond_without java # Java binding
a55ba198 17# - highgui options:
b3920a9d 18%bcond_without ffmpeg # FFMpeg support in highgui
1c9fe580
JB
19%bcond_without gstreamer # GStreamer support in highgui
20%bcond_with openni # OpenNI (Natural Interaction) support in highgui
a55ba198 21%bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
1c9fe580 22%bcond_with qt # Qt backend instead of GTK+ in highgui
1c9fe580 23%bcond_with unicap # Unicap support in highgui (GPL)
a55ba198
JB
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)
1c9fe580 26%bcond_with xine # XINE support in highgui (GPL)
a4737151 27
1c9fe580
JB
28%ifarch pentium3 pentium4 %{x8664}
29%define with_sse 1
30%endif
31%ifarch pentium4 %{x8664}
32%define with_sse2 1
33%endif
901927d3 34Summary: A library of programming functions mainly aimed at real time computer vision
0c2d6b7d 35Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
901927d3 36Name: opencv
9f0b035c 37Version: 2.4.6.2
2240ad73 38Release: 4
901927d3 39Epoch: 1
d5e56e66
JB
40%if %{with unicap} || %{with xine}
41License: GPL (enforced by used libraries), BSD (opencv itself)
42%else
901927d3 43License: BSD
d5e56e66 44%endif
901927d3 45Group: Libraries
9f0b035c
ER
46Source0: https://github.com/Itseez/opencv/archive/%{version}.tar.gz
47# Source0-md5: b9cb3420fa715c2e23f012d42a9b0988
452b38e1 48Patch0: %{name}-cflags.patch
49Patch1: %{name}-link.patch
50Patch2: %{name}-unicap-c++.patch
51Patch3: %{name}-c.patch
52Patch4: %{name}-gcc.patch
809ce413 53Patch5: %{name}-ximea.patch
6994c4f7 54Patch6: %{name}-ocl-fft.patch
a4737151 55Patch7: java-ant-sourcelevel.patch
0c2d6b7d 56URL: http://opencv.willowgarage.com/
d5e56e66 57%{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
8d5385eb 58%{?with_opencl:BuildRequires: OpenCL-devel}
0c2d6b7d 59BuildRequires: OpenEXR-devel
5df3cf1b 60%{?with_opengl:BuildRequires: OpenGL-GLU-devel}
9f0b035c 61%{?with_opengl:BuildRequires: OpenGL-devel}
5df3cf1b 62# as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
1c9fe580 63%{?with_openni:BuildRequires: OpenNI-devel}
a55ba198 64%{?with_ximea:BuildRequires: XIMEA-devel}
b07433c6 65%{?with_java:BuildRequires: ant}
ef4af528
JB
66%{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel}
67%{?with_opencl_amdfft:BuildRequires: clAmdFft-devel}
b07433c6 68BuildRequires: cmake >= 2.8
0c2d6b7d 69BuildRequires: doxygen
809ce413 70BuildRequires: eigen3 >= 3
b3920a9d 71%{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7}
0c2d6b7d
JB
72%if %{with gstreamer}
73BuildRequires: gstreamer-devel >= 0.10
74BuildRequires: gstreamer-plugins-base-devel >= 0.10
75%endif
901927d3 76BuildRequires: jasper-devel
b07433c6 77%{?with_java:BuildRequires: jdk}
901927d3
AM
78BuildRequires: libdc1394-devel
79BuildRequires: libjpeg-devel
80BuildRequires: libpng-devel
81BuildRequires: libraw1394-devel
0c2d6b7d 82BuildRequires: libstdc++-devel
901927d3 83BuildRequires: libtiff-devel
148338c5 84BuildRequires: libtool
d5e56e66
JB
85%if %{with unicap}
86BuildRequires: libucil-devel
87BuildRequires: libunicap-devel
88%endif
0c2d6b7d 89BuildRequires: libv4l-devel
af6d2888 90BuildRequires: pkgconfig
b07433c6 91BuildRequires: python
901927d3 92BuildRequires: python-devel
0c2d6b7d 93BuildRequires: python-numpy-devel
901927d3 94BuildRequires: rpm-pythonprov
8d499a62 95BuildRequires: rpmbuild(macros) >= 1.606
1376dffe 96BuildRequires: sed >= 4.0
996927aa 97BuildRequires: swig-python
f8e040cc 98%{?with_tbb:BuildRequires: tbb-devel}
901927d3 99%{?with_xine:BuildRequires: xine-lib-devel}
452b38e1 100BuildRequires: zlib-devel
4afb606b 101%if %{with qt}
4afb606b
JB
102BuildRequires: QtCore-devel >= 4
103BuildRequires: QtGui-devel >= 4
5df3cf1b 104%{?with_opengl:BuildRequires: QtOpenGL-devel >= 4}
4afb606b
JB
105BuildRequires: qt4-qmake >= 4
106%else
107BuildRequires: gtk+2-devel >= 2.0
5df3cf1b 108%{?with_opengl:BuildRequires: gtkglext-devel >= 1.0}
4afb606b 109%endif
901927d3
AM
110BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
111
933de752
ER
112%define sover %(v=%{version}; k=${v#?.?.?}; echo ${v%$k})
113
97310fd5
ER
114# build broken, can't find g++
115%undefine with_ccache
116
901927d3
AM
117%description
118OpenCV (Open Source Computer Vision) is a library of programming
119functions mainly aimed at real time computer vision.
120
0c2d6b7d
JB
121Example 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
133OpenCV (Open Source Computer Vision) to biblioteka funkcji
134przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
135
136Przykł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.
901927d3 146
933de752
ER
147%package core
148Summary: OpenCV core libraries
149Group: Libraries
150Conflicts: %{name} < 2.4.6.2-1
151
152%description core
153This package contains the OpenCV C/C++ core libraries.
154
901927d3 155%package devel
0c2d6b7d
JB
156Summary: Header files for OpenCV library
157Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
901927d3
AM
158Group: Development/Libraries
159Requires: %{name} = %{epoch}:%{version}-%{release}
0c2d6b7d 160Obsoletes: opencv-static
901927d3
AM
161
162%description devel
0c2d6b7d 163Header files for OpenCV library.
901927d3 164
0c2d6b7d
JB
165%description devel -l pl.UTF-8
166Pliki nagłówkowe biblioteki OpenCV.
901927d3 167
9141b1e2
ER
168%package doc
169Summary: Manual for OpenCV
170Summary(fr.UTF-8): Documentation pour OpenCV
171Summary(it.UTF-8): Documentazione di OpenCV
172Summary(pl.UTF-8): Podręcznik dla OpenCV
173Group: Documentation
174# noarch subpackages only when building with rpm5
175%if "%{_rpmversion}" >= "5"
176BuildArch: noarch
177%endif
178
179%description doc
180Documentation for OpenCV.
181
182%description doc -l fr.UTF-8
183Documentation pour OpenCV.
184
185%description doc -l it.UTF-8
186Documentazione di OpenCV.
187
188%description doc -l pl.UTF-8
189Dokumentacja do OpenCV.
190
b07433c6
JB
191%package -n java-opencv
192Summary: OpenCV Java bindings
193Summary(pl.UTF-8): Wiązania Javy do OpenCV
194Group: Libraries/Java
195Requires: %{name} = %{epoch}:%{version}-%{release}
196Requires: jre
197
198%description -n java-opencv
199OpenCV Java bindings.
200
201%description -n java-opencv -l pl.UTF-8
202Wiązania Javy do OpenCV.
203
901927d3
AM
204%package -n python-opencv
205Summary: OpenCV Python bindings
0c2d6b7d
JB
206Summary(pl.UTF-8): Wiązania Pythona do OpenCV
207Group: Libraries/Python
cd1f0136 208Requires: %{name} = %{epoch}:%{version}-%{release}
9f0b035c 209Requires: python-libs
901927d3
AM
210
211%description -n python-opencv
212OpenCV Python bindings.
213
0c2d6b7d
JB
214%description -n python-opencv -l pl.UTF-8
215Wiązania Pythona do OpenCV.
216
901927d3 217%prep
25269a76 218%setup -q
54551f29 219
da67222a 220%undos CMakeLists.txt
1376dffe 221%undos modules/gpu/CMakeLists.txt
54551f29 222
1376dffe 223%patch0 -p1
224%patch1 -p1
29d82ddf 225%patch2 -p1
f8e040cc 226%patch3 -p1
75b912e9 227%patch4 -p1
809ce413 228%patch5 -p1
6994c4f7 229%patch6 -p1
a4737151 230%patch7 -p1
148338c5 231
901927d3 232%build
95daeb66
AM
233install -d build
234cd build
0c2d6b7d 235%cmake .. \
1c9fe580
JB
236 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
237 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
95daeb66 238 -DBUILD_NEW_PYTHON_SUPPORT=ON \
8b9f61f7 239 -DUSE_O3=OFF \
b3920a9d 240 %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
d5e56e66 241 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
8d5385eb 242 %{?with_opencl:-DWITH_OPENCL=ON} \
faf80a1c
JB
243 %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \
244 %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \
5df3cf1b 245 %{?with_opengl:-DWITH_OPENGL=ON} \
1c9fe580 246 %{?with_openni:-DWITH_OPENNI=ON} \
809ce413 247 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
5df3cf1b 248 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
f8e040cc 249 %{?with_tbb:-DWITH_TBB=ON} \
d5e56e66 250 %{?with_unicap:-DWITH_UNICAP=ON} \
ed358224 251 %{!?with_v4l:-DWITH_V4L=OFF} \
a55ba198 252 %{?with_ximea:-DWITH_XIMEA=ON} \
d5e56e66 253 %{?with_xine:-DWITH_XINE=ON}
54551f29 254
8b9f61f7 255%{__make}
901927d3
AM
256
257%install
258rm -rf $RPM_BUILD_ROOT
95daeb66 259%{__make} -C build install \
901927d3
AM
260 DESTDIR=$RPM_BUILD_ROOT
261
9141b1e2
ER
262# see -doc package
263%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/OpenCV/doc
264
4bd2eae7 265install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
a4737151 266cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
4bd2eae7 267
8d499a62
JB
268%py_comp $RPM_BUILD_ROOT%{py_sitedir}
269%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
270%py_postclean
271
b07433c6
JB
272%if %{with java}
273# move to proper directories, create symlink
274install -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}
277rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
278ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
279%endif
280
901927d3
AM
281%clean
282rm -rf $RPM_BUILD_ROOT
283
284%post -p /sbin/ldconfig
285%postun -p /sbin/ldconfig
286
933de752
ER
287%post core -p /sbin/ldconfig
288%postun core -p /sbin/ldconfig
289
b07433c6
JB
290%post -n java-opencv -p /sbin/ldconfig
291%postun -n java-opencv -p /sbin/ldconfig
292
901927d3
AM
293%files
294%defattr(644,root,root,755)
933de752
ER
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
452b38e1 323%dir %{_datadir}/OpenCV
452b38e1 324%{_datadir}/OpenCV/haarcascades
325%{_datadir}/OpenCV/lbpcascades
901927d3 326
933de752
ER
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
901927d3
AM
342%files devel
343%defattr(644,root,root,755)
0c2d6b7d 344%attr(755,root,root) %{_libdir}/libopencv_*.so
0e077f8d 345%if %{with java}
e0d5b432 346%exclude %{_libdir}/libopencv_java246.so
0e077f8d 347%endif
901927d3 348%{_includedir}/opencv
509c07dc 349%{_includedir}/opencv2
452b38e1 350%{_datadir}/OpenCV/OpenCVConfig*.cmake
0c2d6b7d 351%{_pkgconfigdir}/opencv.pc
901927d3 352
9141b1e2
ER
353%files doc
354%defattr(644,root,root,755)
355# TODO: probably could rebuild them and package via make install
356%doc doc/*
357
b07433c6
JB
358%if %{with java}
359%files -n java-opencv
360%defattr(644,root,root,755)
e0d5b432
ER
361%attr(755,root,root) %{_libdir}/libopencv_java246.so
362%{_javadir}/opencv-246.jar
b07433c6
JB
363%{_javadir}/opencv.jar
364%endif
365
901927d3
AM
366%files -n python-opencv
367%defattr(644,root,root,755)
452b38e1 368%attr(755,root,root) %{py_sitedir}/cv2.so
8d499a62 369%{py_sitedir}/cv.py[co]
This page took 0.122898 seconds and 4 git commands to generate.