]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- package java files
[packages/opencv.git] / opencv.spec
1 #
2 # TODO:
3 # - Smartek GigEVisionSDK (http://www.smartekvision.com/ but I can't see SDK with Linux library?)
4 # - CUDA support (on bcond)
5 # - ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary)
6 #
7 # Conditional build:
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
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
16 # - bindings
17 %bcond_without  java            # Java binding
18 # - highgui options:
19 %bcond_without  ffmpeg          # FFMpeg support in highgui
20 %bcond_without  gstreamer       # GStreamer support in highgui
21 %bcond_with     openni          # OpenNI (Natural Interaction) support in highgui
22 %bcond_with     pvapi           # PvAPI (AVT GigE cameras) support in highgui (proprietary)
23 %bcond_with     qt              # Qt backend instead of GTK+ in highgui
24 %bcond_with     unicap          # Unicap support in highgui (GPL)
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)
27 %bcond_with     xine            # XINE support in highgui (GPL)
28 #
29 %ifarch pentium3 pentium4 %{x8664}
30 %define         with_sse        1
31 %endif
32 %ifarch pentium4 %{x8664}
33 %define         with_sse2       1
34 %endif
35 Summary:        A library of programming functions mainly aimed at real time computer vision
36 Summary(pl.UTF-8):      Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
37 Name:           opencv
38 Version:        2.4.5
39 Release:        1
40 Epoch:          1
41 %if %{with unicap} || %{with xine}
42 License:        GPL (enforced by used libraries), BSD (opencv itself)
43 %else
44 License:        BSD
45 %endif
46 Group:          Libraries
47 Source0:        http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz
48 # Source0-md5:  8eac87462c7bec8b89021b723207c623
49 Patch0:         %{name}-cflags.patch
50 Patch1:         %{name}-link.patch
51 Patch2:         %{name}-unicap-c++.patch
52 Patch3:         %{name}-c.patch
53 Patch4:         %{name}-gcc.patch
54 Patch5:         %{name}-ximea.patch
55 Patch6:         %{name}-ocl-fft.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-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
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 %description
113 OpenCV (Open Source Computer Vision) is a library of programming
114 functions mainly aimed at real time computer vision.
115
116 Example 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
128 OpenCV (Open Source Computer Vision) to biblioteka funkcji
129 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
130
131 Przykł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.
141
142 %package devel
143 Summary:        Header files for OpenCV library
144 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
145 Group:          Development/Libraries
146 Requires:       %{name} = %{epoch}:%{version}-%{release}
147 Obsoletes:      opencv-static
148
149 %description devel
150 Header files for OpenCV library.
151
152 %description devel -l pl.UTF-8
153 Pliki nagłówkowe biblioteki OpenCV.
154
155 %package -n java-opencv
156 Summary:        OpenCV Java bindings
157 Summary(pl.UTF-8):      Wiązania Javy do OpenCV
158 Group:          Libraries/Java
159 Requires:       %{name} = %{epoch}:%{version}-%{release}
160 Requires:       jre
161
162 %description -n java-opencv
163 OpenCV Java bindings.
164
165 %description -n java-opencv -l pl.UTF-8
166 Wiązania Javy do OpenCV.
167
168 %package -n python-opencv
169 Summary:        OpenCV Python bindings
170 Summary(pl.UTF-8):      Wiązania Pythona do OpenCV
171 Group:          Libraries/Python
172 Requires:       %{name} = %{epoch}:%{version}-%{release}
173 %pyrequires_eq  python-libs
174
175 %description -n python-opencv
176 OpenCV Python bindings.
177
178 %description -n python-opencv -l pl.UTF-8
179 Wiązania Pythona do OpenCV.
180
181 %prep
182 %setup -q
183
184 %undos CMakeLists.txt
185 %undos modules/gpu/CMakeLists.txt
186
187 %patch0 -p1
188 %patch1 -p1
189 %patch2 -p1
190 %patch3 -p1
191 %patch4 -p1
192 %patch5 -p1
193 %patch6 -p1
194
195 %build
196 install -d build
197 cd build
198 %cmake .. \
199         -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
200         -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
201         -DBUILD_NEW_PYTHON_SUPPORT=ON \
202         -DUSE_O3=OFF \
203         %{?with_ffmpeg:-DWITH_FFMPEG=ON} \
204         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
205         %{?with_opencl:-DWITH_OPENCL=ON} \
206         %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
207         %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
208         %{?with_opengl:-DWITH_OPENGL=ON} \
209         %{?with_openni:-DWITH_OPENNI=ON} \
210         %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
211         %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
212         %{?with_tbb:-DWITH_TBB=ON} \
213         %{?with_unicap:-DWITH_UNICAP=ON} \
214         %{!?with_v4l:-DWITH_V4L=OFF} \
215         %{?with_ximea:-DWITH_XIMEA=ON} \
216         %{?with_xine:-DWITH_XINE=ON}
217
218 %{__make}
219
220 %install
221 rm -rf $RPM_BUILD_ROOT
222
223 %{__make} -C build install \
224         DESTDIR=$RPM_BUILD_ROOT
225
226 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
227 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
228
229 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
230 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
231 %py_postclean
232
233 %if %{with java}
234 # move to proper directories, create symlink
235 install -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}
238 rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java
239 ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar
240 %endif
241
242 %clean
243 rm -rf $RPM_BUILD_ROOT
244
245 %post   -p /sbin/ldconfig
246 %postun -p /sbin/ldconfig
247
248 %post   -n java-opencv -p /sbin/ldconfig
249 %postun -n java-opencv -p /sbin/ldconfig
250
251 %files
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/opencv_*
254 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
255 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
256 %dir %{_datadir}/OpenCV
257 %doc %{_datadir}/OpenCV/doc
258 %{_datadir}/OpenCV/haarcascades
259 %{_datadir}/OpenCV/lbpcascades
260
261 %files devel
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_libdir}/libopencv_*.so
264 %{_includedir}/opencv
265 %{_includedir}/opencv2
266 %{_datadir}/OpenCV/OpenCVConfig*.cmake
267 %{_pkgconfigdir}/opencv.pc
268
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
277 %files -n python-opencv
278 %defattr(644,root,root,755)
279 %attr(755,root,root) %{py_sitedir}/cv2.so
280 %{py_sitedir}/cv.py[co]
This page took 0.058305 seconds and 3 git commands to generate.