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