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