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