]>
Commit | Line | Data |
---|---|---|
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 | 35 | Summary: A library of programming functions mainly aimed at real time computer vision |
0c2d6b7d | 36 | Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym |
901927d3 | 37 | Name: opencv |
9f0b035c | 38 | Version: 2.4.6.2 |
e0d5b432 | 39 | Release: 1 |
901927d3 | 40 | Epoch: 1 |
d5e56e66 JB |
41 | %if %{with unicap} || %{with xine} |
42 | License: GPL (enforced by used libraries), BSD (opencv itself) | |
43 | %else | |
901927d3 | 44 | License: BSD |
d5e56e66 | 45 | %endif |
901927d3 | 46 | Group: Libraries |
9f0b035c ER |
47 | Source0: https://github.com/Itseez/opencv/archive/%{version}.tar.gz |
48 | # Source0-md5: b9cb3420fa715c2e23f012d42a9b0988 | |
452b38e1 | 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 | |
809ce413 | 54 | Patch5: %{name}-ximea.patch |
6994c4f7 | 55 | Patch6: %{name}-ocl-fft.patch |
a4737151 | 56 | Patch7: java-ant-sourcelevel.patch |
0c2d6b7d | 57 | URL: http://opencv.willowgarage.com/ |
d5e56e66 | 58 | %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel} |
8d5385eb | 59 | %{?with_opencl:BuildRequires: OpenCL-devel} |
0c2d6b7d | 60 | BuildRequires: OpenEXR-devel |
5df3cf1b | 61 | %{?with_opengl:BuildRequires: OpenGL-GLU-devel} |
9f0b035c | 62 | %{?with_opengl:BuildRequires: OpenGL-devel} |
5df3cf1b | 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 | 69 | BuildRequires: cmake >= 2.8 |
0c2d6b7d | 70 | BuildRequires: doxygen |
809ce413 | 71 | BuildRequires: eigen3 >= 3 |
b3920a9d | 72 | %{?with_ffmpeg:BuildRequires: ffmpeg-devel >= 0.7} |
0c2d6b7d JB |
73 | %if %{with gstreamer} |
74 | BuildRequires: gstreamer-devel >= 0.10 | |
75 | BuildRequires: gstreamer-plugins-base-devel >= 0.10 | |
76 | %endif | |
901927d3 | 77 | BuildRequires: jasper-devel |
b07433c6 | 78 | %{?with_java:BuildRequires: jdk} |
901927d3 AM |
79 | BuildRequires: libdc1394-devel |
80 | BuildRequires: libjpeg-devel | |
81 | BuildRequires: libpng-devel | |
82 | BuildRequires: libraw1394-devel | |
0c2d6b7d | 83 | BuildRequires: libstdc++-devel |
901927d3 | 84 | BuildRequires: libtiff-devel |
148338c5 | 85 | BuildRequires: libtool |
d5e56e66 JB |
86 | %if %{with unicap} |
87 | BuildRequires: libucil-devel | |
88 | BuildRequires: libunicap-devel | |
89 | %endif | |
0c2d6b7d | 90 | BuildRequires: libv4l-devel |
af6d2888 | 91 | BuildRequires: pkgconfig |
b07433c6 | 92 | BuildRequires: python |
901927d3 | 93 | BuildRequires: python-devel |
0c2d6b7d | 94 | BuildRequires: python-numpy-devel |
901927d3 | 95 | BuildRequires: rpm-pythonprov |
8d499a62 | 96 | BuildRequires: rpmbuild(macros) >= 1.606 |
1376dffe | 97 | BuildRequires: sed >= 4.0 |
996927aa | 98 | BuildRequires: swig-python |
f8e040cc | 99 | %{?with_tbb:BuildRequires: tbb-devel} |
901927d3 | 100 | %{?with_xine:BuildRequires: xine-lib-devel} |
452b38e1 | 101 | BuildRequires: zlib-devel |
4afb606b | 102 | %if %{with qt} |
4afb606b JB |
103 | BuildRequires: QtCore-devel >= 4 |
104 | BuildRequires: QtGui-devel >= 4 | |
5df3cf1b | 105 | %{?with_opengl:BuildRequires: QtOpenGL-devel >= 4} |
4afb606b JB |
106 | BuildRequires: qt4-qmake >= 4 |
107 | %else | |
108 | BuildRequires: gtk+2-devel >= 2.0 | |
5df3cf1b | 109 | %{?with_opengl:BuildRequires: gtkglext-devel >= 1.0} |
4afb606b | 110 | %endif |
901927d3 AM |
111 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
112 | ||
97310fd5 ER |
113 | # build broken, can't find g++ |
114 | %undefine with_ccache | |
115 | ||
901927d3 AM |
116 | %description |
117 | OpenCV (Open Source Computer Vision) is a library of programming | |
118 | functions mainly aimed at real time computer vision. | |
119 | ||
0c2d6b7d JB |
120 | Example applications of the OpenCV library are: |
121 | - Human-Computer Interaction (HCI) | |
122 | - Object Identification, Segmentation and Recognition | |
123 | - Face Recognition | |
124 | - Gesture Recognition | |
125 | - Motion Tracking | |
126 | - Ego Motion, Motion Understanding | |
127 | - Structure From Motion (SFM) | |
128 | - Stereo and Multi-Camera Calibration and Depth Computation | |
129 | - Mobile Robotics. | |
130 | ||
131 | %description -l pl.UTF-8 | |
132 | OpenCV (Open Source Computer Vision) to biblioteka funkcji | |
133 | przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym. | |
134 | ||
135 | Przykładowe zastosowania biblioteki OpenCV to | |
136 | - interakcje człowiek-komputer (HCI) | |
137 | - identyfikacja, segmentacja i rozpoznawanie obiektów | |
138 | - rozpoznawanie twarzy | |
139 | - rozpoznawanie gestów | |
140 | - śledzenie ruchu | |
141 | - rozumienie ruchu | |
142 | - SFM (Structure From Motion) | |
143 | - kalibracja dwu- i wielokamerowa, obliczanie głębi | |
144 | - robotyka ruchu. | |
901927d3 AM |
145 | |
146 | %package devel | |
0c2d6b7d JB |
147 | Summary: Header files for OpenCV library |
148 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV | |
901927d3 AM |
149 | Group: Development/Libraries |
150 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
0c2d6b7d | 151 | Obsoletes: opencv-static |
901927d3 AM |
152 | |
153 | %description devel | |
0c2d6b7d | 154 | Header files for OpenCV library. |
901927d3 | 155 | |
0c2d6b7d JB |
156 | %description devel -l pl.UTF-8 |
157 | Pliki nagłówkowe biblioteki OpenCV. | |
901927d3 | 158 | |
9141b1e2 ER |
159 | %package doc |
160 | Summary: Manual for OpenCV | |
161 | Summary(fr.UTF-8): Documentation pour OpenCV | |
162 | Summary(it.UTF-8): Documentazione di OpenCV | |
163 | Summary(pl.UTF-8): Podręcznik dla OpenCV | |
164 | Group: Documentation | |
165 | # noarch subpackages only when building with rpm5 | |
166 | %if "%{_rpmversion}" >= "5" | |
167 | BuildArch: noarch | |
168 | %endif | |
169 | ||
170 | %description doc | |
171 | Documentation for OpenCV. | |
172 | ||
173 | %description doc -l fr.UTF-8 | |
174 | Documentation pour OpenCV. | |
175 | ||
176 | %description doc -l it.UTF-8 | |
177 | Documentazione di OpenCV. | |
178 | ||
179 | %description doc -l pl.UTF-8 | |
180 | Dokumentacja do OpenCV. | |
181 | ||
b07433c6 JB |
182 | %package -n java-opencv |
183 | Summary: OpenCV Java bindings | |
184 | Summary(pl.UTF-8): Wiązania Javy do OpenCV | |
185 | Group: Libraries/Java | |
186 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
187 | Requires: jre | |
188 | ||
189 | %description -n java-opencv | |
190 | OpenCV Java bindings. | |
191 | ||
192 | %description -n java-opencv -l pl.UTF-8 | |
193 | Wiązania Javy do OpenCV. | |
194 | ||
901927d3 AM |
195 | %package -n python-opencv |
196 | Summary: OpenCV Python bindings | |
0c2d6b7d JB |
197 | Summary(pl.UTF-8): Wiązania Pythona do OpenCV |
198 | Group: Libraries/Python | |
cd1f0136 | 199 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9f0b035c | 200 | Requires: python-libs |
901927d3 AM |
201 | |
202 | %description -n python-opencv | |
203 | OpenCV Python bindings. | |
204 | ||
0c2d6b7d JB |
205 | %description -n python-opencv -l pl.UTF-8 |
206 | Wiązania Pythona do OpenCV. | |
207 | ||
901927d3 | 208 | %prep |
25269a76 | 209 | %setup -q |
54551f29 | 210 | |
da67222a | 211 | %undos CMakeLists.txt |
1376dffe | 212 | %undos modules/gpu/CMakeLists.txt |
54551f29 | 213 | |
1376dffe | 214 | %patch0 -p1 |
215 | %patch1 -p1 | |
29d82ddf | 216 | %patch2 -p1 |
f8e040cc | 217 | %patch3 -p1 |
75b912e9 | 218 | %patch4 -p1 |
809ce413 | 219 | %patch5 -p1 |
6994c4f7 | 220 | %patch6 -p1 |
a4737151 | 221 | %patch7 -p1 |
148338c5 | 222 | |
901927d3 | 223 | %build |
95daeb66 AM |
224 | install -d build |
225 | cd build | |
0c2d6b7d | 226 | %cmake .. \ |
1c9fe580 JB |
227 | -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \ |
228 | -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \ | |
95daeb66 | 229 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ |
8b9f61f7 | 230 | -DUSE_O3=OFF \ |
b3920a9d | 231 | %{?with_ffmpeg:-DWITH_FFMPEG=ON} \ |
d5e56e66 | 232 | %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \ |
8d5385eb | 233 | %{?with_opencl:-DWITH_OPENCL=ON} \ |
faf80a1c JB |
234 | %{!?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=OFF} \ |
235 | %{!?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=OFF} \ | |
5df3cf1b | 236 | %{?with_opengl:-DWITH_OPENGL=ON} \ |
1c9fe580 | 237 | %{?with_openni:-DWITH_OPENNI=ON} \ |
809ce413 | 238 | %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \ |
5df3cf1b | 239 | %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \ |
f8e040cc | 240 | %{?with_tbb:-DWITH_TBB=ON} \ |
d5e56e66 | 241 | %{?with_unicap:-DWITH_UNICAP=ON} \ |
ed358224 | 242 | %{!?with_v4l:-DWITH_V4L=OFF} \ |
a55ba198 | 243 | %{?with_ximea:-DWITH_XIMEA=ON} \ |
d5e56e66 | 244 | %{?with_xine:-DWITH_XINE=ON} |
54551f29 | 245 | |
8b9f61f7 | 246 | %{__make} |
901927d3 AM |
247 | |
248 | %install | |
249 | rm -rf $RPM_BUILD_ROOT | |
95daeb66 | 250 | %{__make} -C build install \ |
901927d3 AM |
251 | DESTDIR=$RPM_BUILD_ROOT |
252 | ||
9141b1e2 ER |
253 | # see -doc package |
254 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/OpenCV/doc | |
255 | ||
4bd2eae7 | 256 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} |
a4737151 | 257 | cp -p build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir} |
4bd2eae7 | 258 | |
8d499a62 JB |
259 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
260 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
261 | %py_postclean | |
262 | ||
b07433c6 JB |
263 | %if %{with java} |
264 | # move to proper directories, create symlink | |
265 | install -d $RPM_BUILD_ROOT%{_javadir} | |
266 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/libopencv_java*.so $RPM_BUILD_ROOT%{_libdir} | |
267 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/OpenCV/java/opencv-*.jar $RPM_BUILD_ROOT%{_javadir} | |
268 | rmdir $RPM_BUILD_ROOT%{_datadir}/OpenCV/java | |
269 | ln -sf $(basename $RPM_BUILD_ROOT%{_javadir}/opencv-*.jar) $RPM_BUILD_ROOT%{_javadir}/opencv.jar | |
270 | %endif | |
271 | ||
901927d3 AM |
272 | %clean |
273 | rm -rf $RPM_BUILD_ROOT | |
274 | ||
275 | %post -p /sbin/ldconfig | |
276 | %postun -p /sbin/ldconfig | |
277 | ||
b07433c6 JB |
278 | %post -n java-opencv -p /sbin/ldconfig |
279 | %postun -n java-opencv -p /sbin/ldconfig | |
280 | ||
901927d3 AM |
281 | %files |
282 | %defattr(644,root,root,755) | |
0c2d6b7d JB |
283 | %attr(755,root,root) %{_bindir}/opencv_* |
284 | %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.* | |
8ff92997 | 285 | %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4 |
452b38e1 | 286 | %dir %{_datadir}/OpenCV |
452b38e1 | 287 | %{_datadir}/OpenCV/haarcascades |
288 | %{_datadir}/OpenCV/lbpcascades | |
901927d3 AM |
289 | |
290 | %files devel | |
291 | %defattr(644,root,root,755) | |
0c2d6b7d | 292 | %attr(755,root,root) %{_libdir}/libopencv_*.so |
0e077f8d | 293 | %if %{with java} |
e0d5b432 | 294 | %exclude %{_libdir}/libopencv_java246.so |
0e077f8d | 295 | %endif |
901927d3 | 296 | %{_includedir}/opencv |
509c07dc | 297 | %{_includedir}/opencv2 |
452b38e1 | 298 | %{_datadir}/OpenCV/OpenCVConfig*.cmake |
0c2d6b7d | 299 | %{_pkgconfigdir}/opencv.pc |
901927d3 | 300 | |
9141b1e2 ER |
301 | %files doc |
302 | %defattr(644,root,root,755) | |
303 | # TODO: probably could rebuild them and package via make install | |
304 | %doc doc/* | |
305 | ||
b07433c6 JB |
306 | %if %{with java} |
307 | %files -n java-opencv | |
308 | %defattr(644,root,root,755) | |
e0d5b432 ER |
309 | %attr(755,root,root) %{_libdir}/libopencv_java246.so |
310 | %{_javadir}/opencv-246.jar | |
b07433c6 JB |
311 | %{_javadir}/opencv.jar |
312 | %endif | |
313 | ||
901927d3 AM |
314 | %files -n python-opencv |
315 | %defattr(644,root,root,755) | |
452b38e1 | 316 | %attr(755,root,root) %{py_sitedir}/cv2.so |
8d499a62 | 317 | %{py_sitedir}/cv.py[co] |