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