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