]>
Commit | Line | Data |
---|---|---|
4afb606b | 1 | # TODO: CUDA support (on bcond) |
a8d52c2e | 2 | # |
0c2d6b7d | 3 | # Conditional build: |
d5e56e66 JB |
4 | %bcond_without gstreamer # GStreamer support |
5 | %bcond_with pvapi # PvAPI (AVT GigE cameras) support | |
4afb606b | 6 | %bcond_with qt # Qt backend instead of GTK+ |
f8e040cc | 7 | %bcond_with tbb # Threading Building Blocks support |
d5e56e66 | 8 | %bcond_with unicap # Unicap support (GPL) |
0c2d6b7d | 9 | %bcond_with xine # XINE support (GPL) |
a8d52c2e | 10 | # |
901927d3 | 11 | Summary: A library of programming functions mainly aimed at real time computer vision |
0c2d6b7d | 12 | Summary(pl.UTF-8): Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym |
901927d3 | 13 | Name: opencv |
1376dffe | 14 | Version: 2.2.0 |
a29d85f5 | 15 | Release: 6 |
901927d3 | 16 | Epoch: 1 |
d5e56e66 JB |
17 | %if %{with unicap} || %{with xine} |
18 | License: GPL (enforced by used libraries), BSD (opencv itself) | |
19 | %else | |
901927d3 | 20 | License: BSD |
d5e56e66 | 21 | %endif |
901927d3 | 22 | Group: Libraries |
95daeb66 | 23 | Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2 |
1376dffe | 24 | # Source0-md5: 122c9ac793a46854ef2819fedbbd6b1b |
25 | Patch0: %{name}-multilib.patch | |
26 | Patch1: %{name}-cflags.patch | |
27 | Patch2: %{name}-link.patch | |
f8e040cc | 28 | Patch3: %{name}-unicap-c++.patch |
0c2d6b7d | 29 | URL: http://opencv.willowgarage.com/ |
d5e56e66 | 30 | %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel} |
0c2d6b7d JB |
31 | BuildRequires: OpenEXR-devel |
32 | BuildRequires: cmake >= 2.4 | |
33 | BuildRequires: doxygen | |
f8e040cc | 34 | BuildRequires: eigen >= 2 |
901927d3 | 35 | BuildRequires: ffmpeg-devel |
0c2d6b7d JB |
36 | %if %{with gstreamer} |
37 | BuildRequires: gstreamer-devel >= 0.10 | |
38 | BuildRequires: gstreamer-plugins-base-devel >= 0.10 | |
39 | %endif | |
901927d3 AM |
40 | BuildRequires: jasper-devel |
41 | BuildRequires: libdc1394-devel | |
42 | BuildRequires: libjpeg-devel | |
43 | BuildRequires: libpng-devel | |
44 | BuildRequires: libraw1394-devel | |
0c2d6b7d | 45 | BuildRequires: libstdc++-devel |
901927d3 | 46 | BuildRequires: libtiff-devel |
148338c5 | 47 | BuildRequires: libtool |
d5e56e66 JB |
48 | %if %{with unicap} |
49 | BuildRequires: libucil-devel | |
50 | BuildRequires: libunicap-devel | |
51 | %endif | |
0c2d6b7d | 52 | BuildRequires: libv4l-devel |
af6d2888 | 53 | BuildRequires: pkgconfig |
901927d3 | 54 | BuildRequires: python-devel |
0c2d6b7d | 55 | BuildRequires: python-numpy-devel |
901927d3 | 56 | BuildRequires: rpm-pythonprov |
1376dffe | 57 | BuildRequires: rpmbuild(macros) >= 1.577 |
58 | BuildRequires: sed >= 4.0 | |
996927aa | 59 | BuildRequires: swig-python |
f8e040cc | 60 | %{?with_tbb:BuildRequires: tbb-devel} |
901927d3 | 61 | BuildRequires: zlib-devel |
901927d3 | 62 | %{?with_xine:BuildRequires: xine-lib-devel} |
4afb606b JB |
63 | %if %{with qt} |
64 | BuildRequires: OpenGL-devel | |
65 | BuildRequires: QtCore-devel >= 4 | |
66 | BuildRequires: QtGui-devel >= 4 | |
67 | BuildRequires: QtOpenGL-devel >= 4 | |
68 | BuildRequires: qt4-qmake >= 4 | |
69 | %else | |
70 | BuildRequires: gtk+2-devel >= 2.0 | |
71 | %endif | |
72 | # ipp (libippi): http://software.intel.com/en-us/articles/intel-ipp/ (proprietary) | |
901927d3 AM |
73 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
74 | ||
75 | %description | |
76 | OpenCV (Open Source Computer Vision) is a library of programming | |
77 | functions mainly aimed at real time computer vision. | |
78 | ||
0c2d6b7d JB |
79 | Example applications of the OpenCV library are: |
80 | - Human-Computer Interaction (HCI) | |
81 | - Object Identification, Segmentation and Recognition | |
82 | - Face Recognition | |
83 | - Gesture Recognition | |
84 | - Motion Tracking | |
85 | - Ego Motion, Motion Understanding | |
86 | - Structure From Motion (SFM) | |
87 | - Stereo and Multi-Camera Calibration and Depth Computation | |
88 | - Mobile Robotics. | |
89 | ||
90 | %description -l pl.UTF-8 | |
91 | OpenCV (Open Source Computer Vision) to biblioteka funkcji | |
92 | przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym. | |
93 | ||
94 | Przykładowe zastosowania biblioteki OpenCV to | |
95 | - interakcje człowiek-komputer (HCI) | |
96 | - identyfikacja, segmentacja i rozpoznawanie obiektów | |
97 | - rozpoznawanie twarzy | |
98 | - rozpoznawanie gestów | |
99 | - śledzenie ruchu | |
100 | - rozumienie ruchu | |
101 | - SFM (Structure From Motion) | |
102 | - kalibracja dwu- i wielokamerowa, obliczanie głębi | |
103 | - robotyka ruchu. | |
901927d3 AM |
104 | |
105 | %package devel | |
0c2d6b7d JB |
106 | Summary: Header files for OpenCV library |
107 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki OpenCV | |
901927d3 AM |
108 | Group: Development/Libraries |
109 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
0c2d6b7d | 110 | Obsoletes: opencv-static |
901927d3 AM |
111 | |
112 | %description devel | |
0c2d6b7d | 113 | Header files for OpenCV library. |
901927d3 | 114 | |
0c2d6b7d JB |
115 | %description devel -l pl.UTF-8 |
116 | Pliki nagłówkowe biblioteki OpenCV. | |
901927d3 AM |
117 | |
118 | %package -n python-opencv | |
119 | Summary: OpenCV Python bindings | |
0c2d6b7d JB |
120 | Summary(pl.UTF-8): Wiązania Pythona do OpenCV |
121 | Group: Libraries/Python | |
cd1f0136 | 122 | Requires: %{name} = %{epoch}:%{version}-%{release} |
0c2d6b7d | 123 | %pyrequires_eq python-libs |
901927d3 AM |
124 | |
125 | %description -n python-opencv | |
126 | OpenCV Python bindings. | |
127 | ||
0c2d6b7d JB |
128 | %description -n python-opencv -l pl.UTF-8 |
129 | Wiązania Pythona do OpenCV. | |
130 | ||
901927d3 | 131 | %prep |
95daeb66 | 132 | %setup -q -n OpenCV-%{version} |
54551f29 | 133 | |
da67222a | 134 | %undos CMakeLists.txt |
1376dffe | 135 | %undos modules/gpu/CMakeLists.txt |
54551f29 | 136 | |
1376dffe | 137 | %patch0 -p1 |
138 | %patch1 -p1 | |
29d82ddf | 139 | %patch2 -p1 |
f8e040cc | 140 | %patch3 -p1 |
148338c5 | 141 | |
901927d3 | 142 | %build |
95daeb66 AM |
143 | install -d build |
144 | cd build | |
0c2d6b7d | 145 | %cmake .. \ |
8b9f61f7 JB |
146 | -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \ |
147 | -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \ | |
148 | %ifarch pentium4 %{x8664} | |
149 | -DENABLE_SSE=ON \ | |
95daeb66 | 150 | -DENABLE_SSE2=ON \ |
8b9f61f7 JB |
151 | %else |
152 | -DENABLE_SSE=OFF \ | |
153 | -DENABLE_SSE2=OFF \ | |
95daeb66 AM |
154 | %endif |
155 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ | |
8b9f61f7 | 156 | -DUSE_O3=OFF \ |
d5e56e66 JB |
157 | %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \ |
158 | %{!?with_pvapi:-DWITH_PVAPI=OFF} \ | |
4afb606b | 159 | %{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \ |
f8e040cc | 160 | %{?with_tbb:-DWITH_TBB=ON} \ |
d5e56e66 JB |
161 | %{?with_unicap:-DWITH_UNICAP=ON} \ |
162 | %{?with_xine:-DWITH_XINE=ON} | |
54551f29 | 163 | |
8b9f61f7 | 164 | %{__make} |
901927d3 AM |
165 | |
166 | %install | |
167 | rm -rf $RPM_BUILD_ROOT | |
168 | ||
95daeb66 | 169 | %{__make} -C build install \ |
901927d3 AM |
170 | DESTDIR=$RPM_BUILD_ROOT |
171 | ||
4bd2eae7 AM |
172 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} |
173 | install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir} | |
174 | ||
a29d85f5 | 175 | %if "%{_lib}" == "lib64" |
9175d525 AM |
176 | # upstream has no lib64 support |
177 | mv $RPM_BUILD_ROOT%{_prefix}/lib/lib*.so* $RPM_BUILD_ROOT%{_libdir} | |
178 | %endif | |
179 | ||
901927d3 AM |
180 | %clean |
181 | rm -rf $RPM_BUILD_ROOT | |
182 | ||
183 | %post -p /sbin/ldconfig | |
184 | %postun -p /sbin/ldconfig | |
185 | ||
186 | %files | |
187 | %defattr(644,root,root,755) | |
0c2d6b7d JB |
188 | %attr(755,root,root) %{_bindir}/opencv_* |
189 | %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.* | |
190 | %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.2 | |
4bd2eae7 | 191 | %dir %{_datadir}/opencv |
0c2d6b7d | 192 | %doc %{_datadir}/opencv/doc |
4bd2eae7 AM |
193 | %{_datadir}/opencv/haarcascades |
194 | %{_datadir}/opencv/lbpcascades | |
901927d3 AM |
195 | |
196 | %files devel | |
197 | %defattr(644,root,root,755) | |
0c2d6b7d | 198 | %attr(755,root,root) %{_libdir}/libopencv_*.so |
901927d3 | 199 | %{_includedir}/opencv |
509c07dc | 200 | %{_includedir}/opencv2 |
4bd2eae7 | 201 | %{_datadir}/opencv/OpenCVConfig.cmake |
0c2d6b7d | 202 | %{_pkgconfigdir}/opencv.pc |
901927d3 AM |
203 | |
204 | %files -n python-opencv | |
205 | %defattr(644,root,root,755) | |
4bd2eae7 | 206 | %attr(755,root,root) %{py_sitedir}/cv.so |