]> git.pld-linux.org Git - packages/opencv.git/blame - opencv.spec
- package java files
[packages/opencv.git] / opencv.spec
CommitLineData
452b38e1 1#
8d499a62 2# TODO:
2acd8ac1 3# - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
8d499a62 4# - CUDA support (on bcond)
5df3cf1b 5# - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
a8d52c2e 6#
0c2d6b7d 7# Conditional build:
a55ba198
JB
8# - general options:
9%bcond_with tbb # Threading Building Blocks support (everywhere)
10%bcond_with sse # use SSE instructions
11%bcond_with sse2 # use SSE2 instructions
8d5385eb
JB
12%bcond_without opencl # OpenCL support
13%bcond_with opencl_amdblas # AMD OpenCL BLAS routines
14%bcond_with opencl_amdfft # AMD OpenCL FFT routines
15%bcond_without opengl # OpenGL support
b07433c6
JB
16# - bindings
17%bcond_without java # Java binding
a55ba198 18# - highgui options:
b3920a9d 19%bcond_without ffmpeg # FFMpeg support in highgui
1c9fe580
JB
20%bcond_without gstreamer # GStreamer support in highgui
21%bcond_with openni # OpenNI (Natural Interaction) support in highgui
a55ba198 22%bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary)
1c9fe580 23%bcond_with qt # Qt backend instead of GTK+ in highgui
1c9fe580 24%bcond_with unicap # Unicap support in highgui (GPL)
a55ba198
JB
25%bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API)
26%bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary)
1c9fe580 27%bcond_with xine # XINE support in highgui (GPL)
a8d52c2e 28#
1c9fe580
JB
29%ifarch pentium3 pentium4 %{x8664}
30%define with_sse 1
31%endif
32%ifarch pentium4 %{x8664}
33%define with_sse2 1
34%endif
901927d3 35Summary: A library of programming functions mainly aimed at real time computer vision
0c2d6b7d 36Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
901927d3 37Name: opencv
25269a76
MK
38Version: 2.4.5
39Release: 1
901927d3 40Epoch: 1
d5e56e66
JB
41%if %{with unicap} || %{with xine}
42License: GPL (enforced by used libraries), BSD (opencv itself)
43%else
901927d3 44License: BSD
d5e56e66 45%endif
901927d3 46Group: Libraries
25269a76
MK
47Source0: http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz
48# Source0-md5: 8eac87462c7bec8b89021b723207c623
452b38e1 49Patch0: %{name}-cflags.patch
50Patch1: %{name}-link.patch
51Patch2: %{name}-unicap-c++.patch
52Patch3: %{name}-c.patch
53Patch4: %{name}-gcc.patch
809ce413 54Patch5: %{name}-ximea.patch
6994c4f7 55Patch6: %{name}-ocl-fft.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
JB
60%{?with_opengl:BuildRequires: OpenGL-devel}
61%{?with_opengl:BuildRequires: OpenGL-GLU-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
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
112%description
113OpenCV (Open Source Computer Vision) is a library of programming
114functions mainly aimed at real time computer vision.
115
0c2d6b7d
JB
116Example applications of the OpenCV library are:
117- Human-Computer Interaction (HCI)
118- Object Identification, Segmentation and Recognition
119- Face Recognition
120- Gesture Recognition
121- Motion Tracking
122- Ego Motion, Motion Understanding
123- Structure From Motion (SFM)
124- Stereo and Multi-Camera Calibration and Depth Computation
125- Mobile Robotics.
126
127%description -l pl.UTF-8
128OpenCV (Open Source Computer Vision) to biblioteka funkcji
129przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
130
131Przykładowe zastosowania biblioteki OpenCV to
132- interakcje człowiek-komputer (HCI)
133- identyfikacja, segmentacja i rozpoznawanie obiektów
134- rozpoznawanie twarzy
135- rozpoznawanie gestów
136- śledzenie ruchu
137- rozumienie ruchu
138- SFM (Structure From Motion)
139- kalibracja dwu- i wielokamerowa, obliczanie głębi
140- robotyka ruchu.
901927d3
AM
141
142%package devel
0c2d6b7d
JB
143Summary: Header files for OpenCV library
144Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
901927d3
AM
145Group: Development/Libraries
146Requires: %{name} = %{epoch}:%{version}-%{release}
0c2d6b7d 147Obsoletes: opencv-static
901927d3
AM
148
149%description devel
0c2d6b7d 150Header files for OpenCV library.
901927d3 151
0c2d6b7d
JB
152%description devel -l pl.UTF-8
153Pliki nagłówkowe biblioteki OpenCV.
901927d3 154
b07433c6
JB
155%package -n java-opencv
156Summary: OpenCV Java bindings
157Summary(pl.UTF-8): Wiązania Javy do OpenCV
158Group: Libraries/Java
159Requires: %{name} = %{epoch}:%{version}-%{release}
160Requires: jre
161
162%description -n java-opencv
163OpenCV Java bindings.
164
165%description -n java-opencv -l pl.UTF-8
166Wiązania Javy do OpenCV.
167
901927d3
AM
168%package -n python-opencv
169Summary: OpenCV Python bindings
0c2d6b7d
JB
170Summary(pl.UTF-8): Wiązania Pythona do OpenCV
171Group: Libraries/Python
cd1f0136 172Requires: %{name} = %{epoch}:%{version}-%{release}
0c2d6b7d 173%pyrequires_eq python-libs
901927d3
AM
174
175%description -n python-opencv
176OpenCV Python bindings.
177
0c2d6b7d
JB
178%description -n python-opencv -l pl.UTF-8
179Wiązania Pythona do OpenCV.
180
901927d3 181%prep
25269a76 182%setup -q
54551f29 183
da67222a 184%undos CMakeLists.txt
1376dffe 185%undos modules/gpu/CMakeLists.txt
54551f29 186
1376dffe 187%patch0 -p1
188%patch1 -p1
29d82ddf 189%patch2 -p1
f8e040cc 190%patch3 -p1
75b912e9 191%patch4 -p1
809ce413 192%patch5 -p1
6994c4f7 193%patch6 -p1
148338c5 194
901927d3 195%build
95daeb66
AM
196install -d build
197cd build
0c2d6b7d 198%cmake .. \
1c9fe580
JB
199 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
200 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
95daeb66 201 -DBUILD_NEW_PYTHON_SUPPORT=ON \
8b9f61f7 202 -DUSE_O3=OFF \
b3920a9d 203 %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
d5e56e66 204 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
8d5385eb
JB
205 %{?with_opencl:-DWITH_OPENCL=ON} \
206 %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
207 %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
5df3cf1b 208 %{?with_opengl:-DWITH_OPENGL=ON} \
1c9fe580 209 %{?with_openni:-DWITH_OPENNI=ON} \
809ce413 210 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
5df3cf1b 211 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
f8e040cc 212 %{?with_tbb:-DWITH_TBB=ON} \
d5e56e66 213 %{?with_unicap:-DWITH_UNICAP=ON} \
ed358224 214 %{!?with_v4l:-DWITH_V4L=OFF} \
a55ba198 215 %{?with_ximea:-DWITH_XIMEA=ON} \
d5e56e66 216 %{?with_xine:-DWITH_XINE=ON}
54551f29 217
8b9f61f7 218%{__make}
901927d3
AM
219
220%install
221rm -rf $RPM_BUILD_ROOT
222
95daeb66 223%{__make} -C build install \
901927d3
AM
224 DESTDIR=$RPM_BUILD_ROOT
225
4bd2eae7
AM
226install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
227install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
228
8d499a62
JB
229%py_comp $RPM_BUILD_ROOT%{py_sitedir}
230%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
231%py_postclean
232
b07433c6
JB
233%if %{with java}
234# move to proper directories, create symlink
235install -d $RPM_BUILD_ROOT%{_javadir}
236%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
237%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
238rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
239ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
240%endif
241
901927d3
AM
242%clean
243rm -rf $RPM_BUILD_ROOT
244
245%post -p /sbin/ldconfig
246%postun -p /sbin/ldconfig
247
b07433c6
JB
248%post -n java-opencv -p /sbin/ldconfig
249%postun -n java-opencv -p /sbin/ldconfig
250
901927d3
AM
251%files
252%defattr(644,root,root,755)
0c2d6b7d
JB
253%attr(755,root,root) %{_bindir}/opencv_*
254%attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
8ff92997 255%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
452b38e1 256%dir %{_datadir}/OpenCV
257%doc %{_datadir}/OpenCV/doc
258%{_datadir}/OpenCV/haarcascades
259%{_datadir}/OpenCV/lbpcascades
901927d3
AM
260
261%files devel
262%defattr(644,root,root,755)
0c2d6b7d 263%attr(755,root,root) %{_libdir}/libopencv_*.so
901927d3 264%{_includedir}/opencv
509c07dc 265%{_includedir}/opencv2
452b38e1 266%{_datadir}/OpenCV/OpenCVConfig*.cmake
0c2d6b7d 267%{_pkgconfigdir}/opencv.pc
901927d3 268
b07433c6
JB
269%if %{with java}
270%files -n java-opencv
271%defattr(644,root,root,755)
272%attr(755,root,root) %{_libdir}/libopencv_java245.so
273%{_javadir}/opencv-245.jar
274%{_javadir}/opencv.jar
275%endif
276
901927d3
AM
277%files -n python-opencv
278%defattr(644,root,root,755)
452b38e1 279%attr(755,root,root) %{py_sitedir}/cv2.so
8d499a62 280%{py_sitedir}/cv.py[co]
This page took 0.156139 seconds and 4 git commands to generate.