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