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