]>
Commit | Line | Data |
---|---|---|
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 | # - highgui options: | |
17 | %bcond_without ffmpeg # FFMpeg support in highgui | |
18 | %bcond_without gstreamer # GStreamer support in highgui | |
19 | %bcond_with openni # OpenNI (Natural Interaction) support in highgui | |
20 | %bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary) | |
21 | %bcond_with qt # Qt backend instead of GTK+ in highgui | |
22 | %bcond_with unicap # Unicap support in highgui (GPL) | |
23 | %bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API) | |
24 | %bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary) | |
25 | %bcond_with xine # XINE support in highgui (GPL) | |
26 | # | |
27 | %ifarch pentium3 pentium4 %{x8664} | |
28 | %define with_sse 1 | |
29 | %endif | |
30 | %ifarch pentium4 %{x8664} | |
31 | %define with_sse2 1 | |
32 | %endif | |
33 | Summary: A library of programming functions mainly aimed at real time computer vision | |
34 | Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym | |
35 | Name: opencv | |
36 | Version: 2.4.3 | |
37 | Release: 1 | |
38 | Epoch: 1 | |
39 | %if %{with unicap} || %{with xine} | |
40 | License: GPL (enforced by used libraries), BSD (opencv itself) | |
41 | %else | |
42 | License: BSD | |
43 | %endif | |
44 | Group: Libraries | |
45 | Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2 | |
46 | # Source0-md5: c0a5af4ff9d0d540684c0bf00ef35dbe | |
47 | Patch0: %{name}-cflags.patch | |
48 | Patch1: %{name}-link.patch | |
49 | Patch2: %{name}-unicap-c++.patch | |
50 | Patch3: %{name}-c.patch | |
51 | Patch4: %{name}-gcc.patch | |
52 | Patch5: %{name}-ximea.patch | |
53 | Patch6: %{name}-ocl-fft.patch | |
54 | Patch7: %{name}-ocl-blas.patch | |
55 | URL: http://opencv.willowgarage.com/ | |
56 | %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel} | |
57 | %{?with_opencl:BuildRequires: OpenCL-devel} | |
58 | BuildRequires: OpenEXR-devel | |
59 | %{?with_opengl:BuildRequires: OpenGL-devel} | |
60 | %{?with_opengl:BuildRequires: OpenGL-GLU-devel} | |
61 | # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used | |
62 | %{?with_openni:BuildRequires: OpenNI-devel} | |
63 | %{?with_ximea:BuildRequires: XIMEA-devel} | |
64 | %{?with_opencl_amdblas:BuildRequires: clAmdBlas-devel} | |
65 | %{?with_opencl_amdfft:BuildRequires: clAmdFft-devel} | |
66 | BuildRequires: cmake >= 2.4 | |
67 | BuildRequires: doxygen | |
68 | BuildRequires: eigen3 >= 3 | |
69 | %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7} | |
70 | %if %{with gstreamer} | |
71 | BuildRequires: gstreamer-devel >= 0.10 | |
72 | BuildRequires: gstreamer-plugins-base-devel >= 0.10 | |
73 | %endif | |
74 | BuildRequires: jasper-devel | |
75 | BuildRequires: libdc1394-devel | |
76 | BuildRequires: libjpeg-devel | |
77 | BuildRequires: libpng-devel | |
78 | BuildRequires: libraw1394-devel | |
79 | BuildRequires: libstdc++-devel | |
80 | BuildRequires: libtiff-devel | |
81 | BuildRequires: libtool | |
82 | %if %{with unicap} | |
83 | BuildRequires: libucil-devel | |
84 | BuildRequires: libunicap-devel | |
85 | %endif | |
86 | BuildRequires: libv4l-devel | |
87 | BuildRequires: pkgconfig | |
88 | BuildRequires: python-devel | |
89 | BuildRequires: python-numpy-devel | |
90 | BuildRequires: rpm-pythonprov | |
91 | BuildRequires: rpmbuild(macros) >= 1.606 | |
92 | BuildRequires: sed >= 4.0 | |
93 | BuildRequires: swig-python | |
94 | %{?with_tbb:BuildRequires: tbb-devel} | |
95 | %{?with_xine:BuildRequires: xine-lib-devel} | |
96 | BuildRequires: zlib-devel | |
97 | %if %{with qt} | |
98 | BuildRequires: QtCore-devel >= 4 | |
99 | BuildRequires: QtGui-devel >= 4 | |
100 | %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4} | |
101 | BuildRequires: qt4-qmake >= 4 | |
102 | %else | |
103 | BuildRequires: gtk+2-devel >= 2.0 | |
104 | %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0} | |
105 | %endif | |
106 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
107 | ||
108 | %description | |
109 | OpenCV (Open Source Computer Vision) is a library of programming | |
110 | functions mainly aimed at real time computer vision. | |
111 | ||
112 | Example applications of the OpenCV library are: | |
113 | - Human-Computer Interaction (HCI) | |
114 | - Object Identification, Segmentation and Recognition | |
115 | - Face Recognition | |
116 | - Gesture Recognition | |
117 | - Motion Tracking | |
118 | - Ego Motion, Motion Understanding | |
119 | - Structure From Motion (SFM) | |
120 | - Stereo and Multi-Camera Calibration and Depth Computation | |
121 | - Mobile Robotics. | |
122 | ||
123 | %description -l pl.UTF-8 | |
124 | OpenCV (Open Source Computer Vision) to biblioteka funkcji | |
125 | przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym. | |
126 | ||
127 | Przykładowe zastosowania biblioteki OpenCV to | |
128 | - interakcje człowiek-komputer (HCI) | |
129 | - identyfikacja, segmentacja i rozpoznawanie obiektów | |
130 | - rozpoznawanie twarzy | |
131 | - rozpoznawanie gestów | |
132 | - śledzenie ruchu | |
133 | - rozumienie ruchu | |
134 | - SFM (Structure From Motion) | |
135 | - kalibracja dwu- i wielokamerowa, obliczanie głębi | |
136 | - robotyka ruchu. | |
137 | ||
138 | %package devel | |
139 | Summary: Header files for OpenCV library | |
140 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV | |
141 | Group: Development/Libraries | |
142 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
143 | Obsoletes: opencv-static | |
144 | ||
145 | %description devel | |
146 | Header files for OpenCV library. | |
147 | ||
148 | %description devel -l pl.UTF-8 | |
149 | Pliki nagłówkowe biblioteki OpenCV. | |
150 | ||
151 | %package -n python-opencv | |
152 | Summary: OpenCV Python bindings | |
153 | Summary(pl.UTF-8): Wiązania Pythona do OpenCV | |
154 | Group: Libraries/Python | |
155 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
156 | %pyrequires_eq python-libs | |
157 | ||
158 | %description -n python-opencv | |
159 | OpenCV Python bindings. | |
160 | ||
161 | %description -n python-opencv -l pl.UTF-8 | |
162 | Wiązania Pythona do OpenCV. | |
163 | ||
164 | %prep | |
165 | %setup -q -n OpenCV-%{version} | |
166 | ||
167 | %undos CMakeLists.txt | |
168 | %undos modules/gpu/CMakeLists.txt | |
169 | ||
170 | %patch0 -p1 | |
171 | %patch1 -p1 | |
172 | %patch2 -p1 | |
173 | %patch3 -p1 | |
174 | %patch4 -p1 | |
175 | %patch5 -p1 | |
176 | %patch6 -p1 | |
177 | %patch7 -p1 | |
178 | ||
179 | %build | |
180 | install -d build | |
181 | cd build | |
182 | %cmake .. \ | |
183 | -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \ | |
184 | -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \ | |
185 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ | |
186 | -DUSE_O3=OFF \ | |
187 | %{?with_ffmpeg:-DWITH_FFMPEG=ON} \ | |
188 | %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \ | |
189 | %{?with_opencl:-DWITH_OPENCL=ON} \ | |
190 | %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \ | |
191 | %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \ | |
192 | %{?with_opengl:-DWITH_OPENGL=ON} \ | |
193 | %{?with_openni:-DWITH_OPENNI=ON} \ | |
194 | %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \ | |
195 | %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \ | |
196 | %{?with_tbb:-DWITH_TBB=ON} \ | |
197 | %{?with_unicap:-DWITH_UNICAP=ON} \ | |
198 | %{!?with_v4l:-DWITH_V4L=OFF} \ | |
199 | %{?with_ximea:-DWITH_XIMEA=ON} \ | |
200 | %{?with_xine:-DWITH_XINE=ON} | |
201 | ||
202 | %{__make} | |
203 | ||
204 | %install | |
205 | rm -rf $RPM_BUILD_ROOT | |
206 | ||
207 | %{__make} -C build install \ | |
208 | DESTDIR=$RPM_BUILD_ROOT | |
209 | ||
210 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
211 | install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir} | |
212 | ||
213 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
214 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
215 | %py_postclean | |
216 | ||
217 | %clean | |
218 | rm -rf $RPM_BUILD_ROOT | |
219 | ||
220 | %post -p /sbin/ldconfig | |
221 | %postun -p /sbin/ldconfig | |
222 | ||
223 | %files | |
224 | %defattr(644,root,root,755) | |
225 | %attr(755,root,root) %{_bindir}/opencv_* | |
226 | %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.* | |
227 | %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4 | |
228 | %dir %{_datadir}/OpenCV | |
229 | %doc %{_datadir}/OpenCV/doc | |
230 | %{_datadir}/OpenCV/haarcascades | |
231 | %{_datadir}/OpenCV/lbpcascades | |
232 | ||
233 | %files devel | |
234 | %defattr(644,root,root,755) | |
235 | %attr(755,root,root) %{_libdir}/libopencv_*.so | |
236 | %{_includedir}/opencv | |
237 | %{_includedir}/opencv2 | |
238 | %{_datadir}/OpenCV/OpenCVConfig*.cmake | |
239 | %{_pkgconfigdir}/opencv.pc | |
240 | ||
241 | %files -n python-opencv | |
242 | %defattr(644,root,root,755) | |
243 | %attr(755,root,root) %{py_sitedir}/cv2.so | |
244 | %{py_sitedir}/cv.py[co] |