]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- BRs for opencl_amd* bconds
[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 URL:            http://opencv.willowgarage.com/
53 %{?with_pvapi:BuildRequires:    AVT_GigE_SDK-devel}
54 %{?with_opencl:BuildRequires:   OpenCL-devel}
55 BuildRequires:  OpenEXR-devel
56 %{?with_opengl:BuildRequires:   OpenGL-devel}
57 %{?with_opengl:BuildRequires:   OpenGL-GLU-devel}
58 # as of OpenCV 2.3.1-2.4.3 there is also check for OpenNI-sensor-PrimeSense, but the result is not used
59 %{?with_openni:BuildRequires:   OpenNI-devel}
60 %{?with_ximea:BuildRequires:    XIMEA-devel}
61 %{?with_opencl_amdblas:BuildRequires:   clAmdBlas-devel}
62 %{?with_opencl_amdfft:BuildRequires:    clAmdFft-devel}
63 BuildRequires:  cmake >= 2.4
64 BuildRequires:  doxygen
65 BuildRequires:  eigen3 >= 3
66 BuildRequires:  ffmpeg-devel >= 0.7
67 %if %{with gstreamer}
68 BuildRequires:  gstreamer-devel >= 0.10
69 BuildRequires:  gstreamer-plugins-base-devel >= 0.10
70 %endif
71 BuildRequires:  jasper-devel
72 BuildRequires:  libdc1394-devel
73 BuildRequires:  libjpeg-devel
74 BuildRequires:  libpng-devel
75 BuildRequires:  libraw1394-devel
76 BuildRequires:  libstdc++-devel
77 BuildRequires:  libtiff-devel
78 BuildRequires:  libtool
79 %if %{with unicap}
80 BuildRequires:  libucil-devel
81 BuildRequires:  libunicap-devel
82 %endif
83 BuildRequires:  libv4l-devel
84 BuildRequires:  pkgconfig
85 BuildRequires:  python-devel
86 BuildRequires:  python-numpy-devel
87 BuildRequires:  rpm-pythonprov
88 BuildRequires:  rpmbuild(macros) >= 1.606
89 BuildRequires:  sed >= 4.0
90 BuildRequires:  swig-python
91 %{?with_tbb:BuildRequires:      tbb-devel}
92 %{?with_xine:BuildRequires:     xine-lib-devel}
93 BuildRequires:  zlib-devel
94 %if %{with qt}
95 BuildRequires:  QtCore-devel >= 4
96 BuildRequires:  QtGui-devel >= 4
97 %{?with_opengl:BuildRequires:   QtOpenGL-devel >= 4}
98 BuildRequires:  qt4-qmake >= 4
99 %else
100 BuildRequires:  gtk+2-devel >= 2.0
101 %{?with_opengl:BuildRequires:   gtkglext-devel >= 1.0}
102 %endif
103 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104
105 %description
106 OpenCV (Open Source Computer Vision) is a library of programming
107 functions mainly aimed at real time computer vision.
108
109 Example applications of the OpenCV library are:
110 - Human-Computer Interaction (HCI)
111 - Object Identification, Segmentation and Recognition
112 - Face Recognition
113 - Gesture Recognition
114 - Motion Tracking
115 - Ego Motion, Motion Understanding
116 - Structure From Motion (SFM)
117 - Stereo and Multi-Camera Calibration and Depth Computation
118 - Mobile Robotics.
119
120 %description -l pl.UTF-8
121 OpenCV (Open Source Computer Vision) to biblioteka funkcji
122 przeznaczonych głównie do grafiki komputerowej w czasie rzeczywistym.
123
124 Przykładowe zastosowania biblioteki OpenCV to
125 - interakcje człowiek-komputer (HCI)
126 - identyfikacja, segmentacja i rozpoznawanie obiektów
127 - rozpoznawanie twarzy
128 - rozpoznawanie gestów
129 - śledzenie ruchu
130 - rozumienie ruchu
131 - SFM (Structure From Motion)
132 - kalibracja dwu- i wielokamerowa, obliczanie głębi
133 - robotyka ruchu.
134
135 %package devel
136 Summary:        Header files for OpenCV library
137 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
138 Group:          Development/Libraries
139 Requires:       %{name} = %{epoch}:%{version}-%{release}
140 Obsoletes:      opencv-static
141
142 %description devel
143 Header files for OpenCV library.
144
145 %description devel -l pl.UTF-8
146 Pliki nagłówkowe biblioteki OpenCV.
147
148 %package -n python-opencv
149 Summary:        OpenCV Python bindings
150 Summary(pl.UTF-8):      Wiązania Pythona do OpenCV
151 Group:          Libraries/Python
152 Requires:       %{name} = %{epoch}:%{version}-%{release}
153 %pyrequires_eq  python-libs
154
155 %description -n python-opencv
156 OpenCV Python bindings.
157
158 %description -n python-opencv -l pl.UTF-8
159 Wiązania Pythona do OpenCV.
160
161 %prep
162 %setup -q -n OpenCV-%{version}
163
164 %undos CMakeLists.txt
165 %undos modules/gpu/CMakeLists.txt
166
167 %patch0 -p1
168 %patch1 -p1
169 %patch2 -p1
170 %patch3 -p1
171 %patch4 -p1
172 %patch5 -p1
173
174 %build
175 install -d build
176 cd build
177 %cmake .. \
178         -DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
179         -DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
180         -DBUILD_NEW_PYTHON_SUPPORT=ON \
181         -DUSE_O3=OFF \
182         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
183         %{?with_opencl:-DWITH_OPENCL=ON} \
184         %{?with_opencl_amdblas:-DWITH_OPENCLAMDBLAS=ON} \
185         %{?with_opencl_amdfft:-DWITH_OPENCLAMDFFT=ON} \
186         %{?with_opengl:-DWITH_OPENGL=ON} \
187         %{?with_openni:-DWITH_OPENNI=ON} \
188         %{?with_pvapi:-DPVAPI_LIBRARY=%{_libdir}/libPvAPI.so}%{!?with_pvapi:-DWITH_PVAPI=OFF} \
189         %{?with_qt:-DWITH_QT=ON %{?with_opengl:-DWITH_QT_OPENGL=ON} -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
190         %{?with_tbb:-DWITH_TBB=ON} \
191         %{?with_unicap:-DWITH_UNICAP=ON} \
192         %{!?with_v4l:-DWITH_V4L=OFF} \
193         %{?with_ximea:-DWITH_XIMEA=ON} \
194         %{?with_xine:-DWITH_XINE=ON}
195
196 %{__make}
197
198 %install
199 rm -rf $RPM_BUILD_ROOT
200
201 %{__make} -C build install \
202         DESTDIR=$RPM_BUILD_ROOT
203
204 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
205 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
206
207 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
208 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
209 %py_postclean
210
211 %clean
212 rm -rf $RPM_BUILD_ROOT
213
214 %post   -p /sbin/ldconfig
215 %postun -p /sbin/ldconfig
216
217 %files
218 %defattr(644,root,root,755)
219 %attr(755,root,root) %{_bindir}/opencv_*
220 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
221 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.4
222 %dir %{_datadir}/OpenCV
223 %doc %{_datadir}/OpenCV/doc
224 %{_datadir}/OpenCV/haarcascades
225 %{_datadir}/OpenCV/lbpcascades
226
227 %files devel
228 %defattr(644,root,root,755)
229 %attr(755,root,root) %{_libdir}/libopencv_*.so
230 %{_includedir}/opencv
231 %{_includedir}/opencv2
232 %{_datadir}/OpenCV/OpenCVConfig*.cmake
233 %{_pkgconfigdir}/opencv.pc
234
235 %files -n python-opencv
236 %defattr(644,root,root,755)
237 %attr(755,root,root) %{py_sitedir}/cv2.so
238 %{py_sitedir}/cv.py[co]
This page took 0.085428 seconds and 3 git commands to generate.