]> git.pld-linux.org Git - packages/opencv.git/blob - opencv.spec
- added gcc patch (fixes build with gcc 4.6)
[packages/opencv.git] / opencv.spec
1 # TODO: CUDA support (on bcond)
2 #
3 # Conditional build:
4 %bcond_without  gstreamer       # GStreamer support
5 %bcond_with     pvapi           # PvAPI (AVT GigE cameras) support
6 %bcond_with     qt              # Qt backend instead of GTK+
7 %bcond_with     tbb             # Threading Building Blocks support
8 %bcond_with     unicap          # Unicap support (GPL)
9 %bcond_with     v4l             # Video4Linux (even V4L2 support currently relies on V4L1 API)
10 %bcond_with     xine            # XINE support (GPL)
11 #
12 Summary:        A library of programming functions mainly aimed at real time computer vision
13 Summary(pl.UTF-8):      Biblioteka funkcji do grafiki komputerowej w czasie rzeczywistym
14 Name:           opencv
15 Version:        2.2.0
16 Release:        8
17 Epoch:          1
18 %if %{with unicap} || %{with xine}
19 License:        GPL (enforced by used libraries), BSD (opencv itself)
20 %else
21 License:        BSD
22 %endif
23 Group:          Libraries
24 Source0:        http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2
25 # Source0-md5:  122c9ac793a46854ef2819fedbbd6b1b
26 Patch0:         %{name}-multilib.patch
27 Patch1:         %{name}-cflags.patch
28 Patch2:         %{name}-link.patch
29 Patch3:         %{name}-unicap-c++.patch
30 Patch4:         %{name}-c.patch
31 Patch5:         %{name}-gcc.patch
32 Patch6:         %{name}-ffmpeg-0.8.patch
33 URL:            http://opencv.willowgarage.com/
34 %{?with_pvapi:BuildRequires:    AVT_GigE_SDK-devel}
35 BuildRequires:  OpenEXR-devel
36 BuildRequires:  cmake >= 2.4
37 BuildRequires:  doxygen
38 BuildRequires:  eigen >= 2
39 BuildRequires:  ffmpeg-devel >= 0.6
40 %if %{with gstreamer}
41 BuildRequires:  gstreamer-devel >= 0.10
42 BuildRequires:  gstreamer-plugins-base-devel >= 0.10
43 %endif
44 BuildRequires:  jasper-devel
45 BuildRequires:  libdc1394-devel
46 BuildRequires:  libjpeg-devel
47 BuildRequires:  libpng-devel
48 BuildRequires:  libraw1394-devel
49 BuildRequires:  libstdc++-devel
50 BuildRequires:  libtiff-devel
51 BuildRequires:  libtool
52 %if %{with unicap}
53 BuildRequires:  libucil-devel
54 BuildRequires:  libunicap-devel
55 %endif
56 BuildRequires:  libv4l-devel
57 BuildRequires:  pkgconfig
58 BuildRequires:  python-devel
59 BuildRequires:  python-numpy-devel
60 BuildRequires:  rpm-pythonprov
61 BuildRequires:  rpmbuild(macros) >= 1.577
62 BuildRequires:  sed >= 4.0
63 BuildRequires:  swig-python
64 %{?with_tbb:BuildRequires:      tbb-devel}
65 BuildRequires:  zlib-devel
66 %{?with_xine:BuildRequires:     xine-lib-devel}
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)
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
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.
108
109 %package devel
110 Summary:        Header files for OpenCV library
111 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki OpenCV
112 Group:          Development/Libraries
113 Requires:       %{name} = %{epoch}:%{version}-%{release}
114 Obsoletes:      opencv-static
115
116 %description devel
117 Header files for OpenCV library.
118
119 %description devel -l pl.UTF-8
120 Pliki nagłówkowe biblioteki OpenCV.
121
122 %package -n python-opencv
123 Summary:        OpenCV Python bindings
124 Summary(pl.UTF-8):      Wiązania Pythona do OpenCV
125 Group:          Libraries/Python
126 Requires:       %{name} = %{epoch}:%{version}-%{release}
127 %pyrequires_eq  python-libs
128
129 %description -n python-opencv
130 OpenCV Python bindings.
131
132 %description -n python-opencv -l pl.UTF-8
133 Wiązania Pythona do OpenCV.
134
135 %prep
136 %setup -q -n OpenCV-%{version}
137
138 %undos CMakeLists.txt
139 %undos modules/gpu/CMakeLists.txt
140
141 %patch0 -p1
142 %patch1 -p1
143 %patch2 -p1
144 %patch3 -p1
145 %patch4 -p1
146 %patch5 -p1
147 %patch6 -p1
148
149 %build
150 install -d build
151 cd build
152 %cmake .. \
153         -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
154         -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
155 %ifarch pentium4 %{x8664}
156         -DENABLE_SSE=ON \
157         -DENABLE_SSE2=ON \
158 %else
159         -DENABLE_SSE=OFF \
160         -DENABLE_SSE2=OFF \
161 %endif
162         -DBUILD_NEW_PYTHON_SUPPORT=ON \
163         -DUSE_O3=OFF \
164         %{!?with_gstreamer:-DWITH_GSTREAMER=OFF} \
165         %{!?with_pvapi:-DWITH_PVAPI=OFF} \
166         %{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
167         %{?with_tbb:-DWITH_TBB=ON} \
168         %{?with_unicap:-DWITH_UNICAP=ON} \
169         %{!?with_v4l:-DWITH_V4L=OFF} \
170         %{?with_xine:-DWITH_XINE=ON}
171
172 %{__make}
173
174 %install
175 rm -rf $RPM_BUILD_ROOT
176
177 %{__make} -C build install \
178         DESTDIR=$RPM_BUILD_ROOT
179
180 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
181 install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
182
183 %if "%{_lib}" == "lib64"
184 # upstream has no lib64 support
185 mv $RPM_BUILD_ROOT%{_prefix}/lib/lib*.so* $RPM_BUILD_ROOT%{_libdir}
186 %endif
187
188 %clean
189 rm -rf $RPM_BUILD_ROOT
190
191 %post   -p /sbin/ldconfig
192 %postun -p /sbin/ldconfig
193
194 %files
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_bindir}/opencv_*
197 %attr(755,root,root) %{_libdir}/libopencv_*.so.*.*.*
198 %attr(755,root,root) %ghost %{_libdir}/libopencv_*.so.2.2
199 %dir %{_datadir}/opencv
200 %doc %{_datadir}/opencv/doc
201 %{_datadir}/opencv/haarcascades
202 %{_datadir}/opencv/lbpcascades
203
204 %files devel
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_libdir}/libopencv_*.so
207 %{_includedir}/opencv
208 %{_includedir}/opencv2
209 %{_datadir}/opencv/OpenCVConfig.cmake
210 %{_pkgconfigdir}/opencv.pc
211
212 %files -n python-opencv
213 %defattr(644,root,root,755)
214 %attr(755,root,root) %{py_sitedir}/cv.so
This page took 0.039495 seconds and 3 git commands to generate.