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