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