]> git.pld-linux.org Git - packages/opencv.git/blame - opencv.spec
compile java with lower jre requirement
[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)
a4737151 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 38Version: 2.4.5
a4737151 39Release: 3
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
a4737151 56Patch7: java-ant-sourcelevel.patch
0c2d6b7d 57URL: http://opencv.willowgarage.com/
d5e56e66 58%{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel}
8d5385eb 59%{?with_opencl:BuildRequires: OpenCL-devel}
0c2d6b7d 60BuildRequires: OpenEXR-devel
5df3cf1b
JB
61%{?with_opengl:BuildRequires: OpenGL-devel}
62%{?with_opengl:BuildRequires: OpenGL-GLU-devel}
63# as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
1c9fe580 64%{?with_openni:BuildRequires: OpenNI-devel}
a55ba198 65%{?with_ximea:BuildRequires: XIMEA-devel}
b07433c6 66%{?with_java:BuildRequires: ant}
ef4af528
JB
67%{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel}
68%{?with_opencl_amdfft:BuildRequires: clAmdFft-devel}
b07433c6 69BuildRequires: cmake >= 2.8
0c2d6b7d 70BuildRequires: doxygen
809ce413 71BuildRequires: eigen3 >= 3
b3920a9d 72%{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7}
0c2d6b7d
JB
73%if %{with gstreamer}
74BuildRequires: gstreamer-devel >= 0.10
75BuildRequires: gstreamer-plugins-base-devel >= 0.10
76%endif
901927d3 77BuildRequires: jasper-devel
b07433c6 78%{?with_java:BuildRequires: jdk}
901927d3
AM
79BuildRequires: libdc1394-devel
80BuildRequires: libjpeg-devel
81BuildRequires: libpng-devel
82BuildRequires: libraw1394-devel
0c2d6b7d 83BuildRequires: libstdc++-devel
901927d3 84BuildRequires: libtiff-devel
148338c5 85BuildRequires: libtool
d5e56e66
JB
86%if %{with unicap}
87BuildRequires: libucil-devel
88BuildRequires: libunicap-devel
89%endif
0c2d6b7d 90BuildRequires: libv4l-devel
af6d2888 91BuildRequires: pkgconfig
b07433c6 92BuildRequires: python
901927d3 93BuildRequires: python-devel
0c2d6b7d 94BuildRequires: python-numpy-devel
901927d3 95BuildRequires: rpm-pythonprov
8d499a62 96BuildRequires: rpmbuild(macros) >= 1.606
1376dffe 97BuildRequires: sed >= 4.0
996927aa 98BuildRequires: swig-python
f8e040cc 99%{?with_tbb:BuildRequires: tbb-devel}
901927d3 100%{?with_xine:BuildRequires: xine-lib-devel}
452b38e1 101BuildRequires: zlib-devel
4afb606b 102%if %{with qt}
4afb606b
JB
103BuildRequires: QtCore-devel >= 4
104BuildRequires: QtGui-devel >= 4
5df3cf1b 105%{?with_opengl:BuildRequires: QtOpenGL-devel >= 4}
4afb606b
JB
106BuildRequires: qt4-qmake >= 4
107%else
108BuildRequires: gtk+2-devel >= 2.0
5df3cf1b 109%{?with_opengl:BuildRequires: gtkglext-devel >= 1.0}
4afb606b 110%endif
901927d3
AM
111BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
112
113%description
114OpenCV (Open Source Computer Vision) is a library of programming
115functions mainly aimed at real time computer vision.
116
0c2d6b7d
JB
117Example applications of the OpenCV library are:
118- Human-Computer Interaction (HCI)
119- Object Identification, Segmentation and Recognition
120- Face Recognition
121- Gesture Recognition
122- Motion Tracking
123- Ego Motion, Motion Understanding
124- Structure From Motion (SFM)
125- Stereo and Multi-Camera Calibration and Depth Computation
126- Mobile Robotics.
127
128%description -l pl.UTF-8
129OpenCV (Open Source Computer Vision) to biblioteka funkcji
130przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
131
132Przykładowe zastosowania biblioteki OpenCV to
133- interakcje człowiek-komputer (HCI)
134- identyfikacja, segmentacja i rozpoznawanie obiektów
135- rozpoznawanie twarzy
136- rozpoznawanie gestów
137- śledzenie ruchu
138- rozumienie ruchu
139- SFM (Structure From Motion)
140- kalibracja dwu- i wielokamerowa, obliczanie głębi
141- robotyka ruchu.
901927d3
AM
142
143%package devel
0c2d6b7d
JB
144Summary: Header files for OpenCV library
145Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV
901927d3
AM
146Group: Development/Libraries
147Requires: %{name} = %{epoch}:%{version}-%{release}
0c2d6b7d 148Obsoletes: opencv-static
901927d3
AM
149
150%description devel
0c2d6b7d 151Header files for OpenCV library.
901927d3 152
0c2d6b7d
JB
153%description devel -l pl.UTF-8
154Pliki nagłówkowe biblioteki OpenCV.
901927d3 155
b07433c6
JB
156%package -n java-opencv
157Summary: OpenCV Java bindings
158Summary(pl.UTF-8): Wiązania Javy do OpenCV
159Group: Libraries/Java
160Requires: %{name} = %{epoch}:%{version}-%{release}
161Requires: jre
162
163%description -n java-opencv
164OpenCV Java bindings.
165
166%description -n java-opencv -l pl.UTF-8
167Wiązania Javy do OpenCV.
168
901927d3
AM
169%package -n python-opencv
170Summary: OpenCV Python bindings
0c2d6b7d
JB
171Summary(pl.UTF-8): Wiązania Pythona do OpenCV
172Group: Libraries/Python
cd1f0136 173Requires: %{name} = %{epoch}:%{version}-%{release}
0c2d6b7d 174%pyrequires_eq python-libs
901927d3
AM
175
176%description -n python-opencv
177OpenCV Python bindings.
178
0c2d6b7d
JB
179%description -n python-opencv -l pl.UTF-8
180Wiązania Pythona do OpenCV.
181
901927d3 182%prep
25269a76 183%setup -q
54551f29 184
da67222a 185%undos CMakeLists.txt
1376dffe 186%undos modules/gpu/CMakeLists.txt
54551f29 187
1376dffe 188%patch0 -p1
189%patch1 -p1
29d82ddf 190%patch2 -p1
f8e040cc 191%patch3 -p1
75b912e9 192%patch4 -p1
809ce413 193%patch5 -p1
6994c4f7 194%patch6 -p1
a4737151 195%patch7 -p1
148338c5 196
901927d3 197%build
95daeb66
AM
198install -d build
199cd build
0c2d6b7d 200%cmake .. \
1c9fe580
JB
201 -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
202 -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
95daeb66 203 -DBUILD_NEW_PYTHON_SUPPORT=ON \
8b9f61f7 204 -DUSE_O3=OFF \
b3920a9d 205 %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
d5e56e66 206 %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
8d5385eb
JB
207 %{?with_opencl:-DWITH_OPENCL=ON} \
208 %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
209 %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
5df3cf1b 210 %{?with_opengl:-DWITH_OPENGL=ON} \
1c9fe580 211 %{?with_openni:-DWITH_OPENNI=ON} \
809ce413 212 %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
5df3cf1b 213 %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
f8e040cc 214 %{?with_tbb:-DWITH_TBB=ON} \
d5e56e66 215 %{?with_unicap:-DWITH_UNICAP=ON} \
ed358224 216 %{!?with_v4l:-DWITH_V4L=OFF} \
a55ba198 217 %{?with_ximea:-DWITH_XIMEA=ON} \
d5e56e66 218 %{?with_xine:-DWITH_XINE=ON}
54551f29 219
8b9f61f7 220%{__make}
901927d3
AM
221
222%install
223rm -rf $RPM_BUILD_ROOT
95daeb66 224%{__make} -C build install \
901927d3
AM
225 DESTDIR=$RPM_BUILD_ROOT
226
4bd2eae7 227install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
a4737151 228cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
4bd2eae7 229
8d499a62
JB
230%py_comp $RPM_BUILD_ROOT%{py_sitedir}
231%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
232%py_postclean
233
b07433c6
JB
234%if %{with java}
235# move to proper directories, create symlink
236install -d $RPM_BUILD_ROOT%{_javadir}
237%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir}
238%{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir}
239rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
240ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
241%endif
242
901927d3
AM
243%clean
244rm -rf $RPM_BUILD_ROOT
245
246%post -p /sbin/ldconfig
247%postun -p /sbin/ldconfig
248
b07433c6
JB
249%post -n java-opencv -p /sbin/ldconfig
250%postun -n java-opencv -p /sbin/ldconfig
251
901927d3
AM
252%files
253%defattr(644,root,root,755)
0c2d6b7d
JB
254%attr(755,root,root) %{_bindir}/opencv_*
255%attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
8ff92997 256%attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
452b38e1 257%dir %{_datadir}/OpenCV
258%doc %{_datadir}/OpenCV/doc
259%{_datadir}/OpenCV/haarcascades
260%{_datadir}/OpenCV/lbpcascades
901927d3
AM
261
262%files devel
263%defattr(644,root,root,755)
0c2d6b7d 264%attr(755,root,root) %{_libdir}/libopencv_*.so
0e077f8d
ER
265%if %{with java}
266%exclude %{_libdir}/libopencv_java245.so
267%endif
901927d3 268%{_includedir}/opencv
509c07dc 269%{_includedir}/opencv2
452b38e1 270%{_datadir}/OpenCV/OpenCVConfig*.cmake
0c2d6b7d 271%{_pkgconfigdir}/opencv.pc
901927d3 272
b07433c6
JB
273%if %{with java}
274%files -n java-opencv
275%defattr(644,root,root,755)
276%attr(755,root,root) %{_libdir}/libopencv_java245.so
277%{_javadir}/opencv-245.jar
278%{_javadir}/opencv.jar
279%endif
280
901927d3
AM
281%files -n python-opencv
282%defattr(644,root,root,755)
452b38e1 283%attr(755,root,root) %{py_sitedir}/cv2.so
8d499a62 284%{py_sitedir}/cv.py[co]
This page took 0.134053 seconds and 4 git commands to generate.