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