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