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