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