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