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