]>
Commit | Line | Data |
---|---|---|
a8d52c2e | 1 | # |
2 | # TODO: re-enable static libs | |
3 | # | |
901927d3 | 4 | %bcond_with xine |
901927d3 AM |
5 | Summary: A library of programming functions mainly aimed at real time computer vision |
6 | Name: opencv | |
1376dffe | 7 | Version: 2.2.0 |
9175d525 | 8 | Release: 5 |
901927d3 AM |
9 | Epoch: 1 |
10 | License: BSD | |
11 | Group: Libraries | |
95daeb66 | 12 | Source0: http://downloads.sourceforge.net/opencvlibrary/OpenCV-%{version}.tar.bz2 |
1376dffe | 13 | # Source0-md5: 122c9ac793a46854ef2819fedbbd6b1b |
14 | Patch0: %{name}-multilib.patch | |
15 | Patch1: %{name}-cflags.patch | |
16 | Patch2: %{name}-link.patch | |
901927d3 | 17 | URL: http://opencv.willowgarage.com |
95daeb66 | 18 | BuildRequires: cmake |
901927d3 AM |
19 | BuildRequires: ffmpeg-devel |
20 | BuildRequires: jasper-devel | |
21 | BuildRequires: libdc1394-devel | |
22 | BuildRequires: libjpeg-devel | |
23 | BuildRequires: libpng-devel | |
24 | BuildRequires: libraw1394-devel | |
25 | BuildRequires: libtiff-devel | |
148338c5 | 26 | BuildRequires: libtool |
af6d2888 | 27 | BuildRequires: pkgconfig |
901927d3 AM |
28 | BuildRequires: python-devel |
29 | BuildRequires: rpm-pythonprov | |
1376dffe | 30 | BuildRequires: rpmbuild(macros) >= 1.577 |
31 | BuildRequires: sed >= 4.0 | |
996927aa | 32 | BuildRequires: swig-python |
901927d3 AM |
33 | BuildRequires: zlib-devel |
34 | %pyrequires_eq python-libs | |
35 | %{?with_xine:BuildRequires: xine-lib-devel} | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
cc676705 | 38 | %define skip_post_check_so libhighgui.so.%{version} |
39 | ||
901927d3 AM |
40 | %description |
41 | OpenCV (Open Source Computer Vision) is a library of programming | |
42 | functions mainly aimed at real time computer vision. | |
43 | ||
44 | Example applications of the OpenCV library are Human-Computer | |
45 | Interaction (HCI); Object Identification, Segmentation and | |
46 | Recognition; Face Recognition; Gesture Recognition; Motion Tracking, | |
47 | Ego Motion, Motion Understanding; Structure From Motion (SFM); Stereo | |
48 | and Multi-Camera Calibration and Depth Computation; Mobile Robotics. | |
49 | ||
50 | %package devel | |
51 | Summary: Header files and develpment documentation for opencv | |
52 | Group: Development/Libraries | |
53 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
54 | ||
55 | %description devel | |
56 | Header files and opencv documentation. | |
57 | ||
58 | %package static | |
59 | Summary: Static opencv library | |
60 | Group: Development/Libraries | |
61 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} | |
62 | ||
63 | %description static | |
64 | This package contains the static library used for development. | |
65 | ||
66 | %package -n python-opencv | |
67 | Summary: OpenCV Python bindings | |
68 | Group: Development/Languages/Python | |
69 | %pyrequires_eq python | |
cd1f0136 | 70 | Requires: %{name} = %{epoch}:%{version}-%{release} |
901927d3 AM |
71 | |
72 | %description -n python-opencv | |
73 | OpenCV Python bindings. | |
74 | ||
75 | %prep | |
95daeb66 | 76 | %setup -q -n OpenCV-%{version} |
54551f29 | 77 | |
da67222a | 78 | %undos CMakeLists.txt |
1376dffe | 79 | %undos modules/gpu/CMakeLists.txt |
54551f29 | 80 | |
1376dffe | 81 | %patch0 -p1 |
82 | %patch1 -p1 | |
29d82ddf | 83 | %patch2 -p1 |
148338c5 | 84 | |
901927d3 | 85 | %build |
95daeb66 AM |
86 | install -d build |
87 | cd build | |
88 | %cmake \ | |
901927d3 | 89 | %ifarch i686 pentium4 athlon %{x8664} |
95daeb66 AM |
90 | -DENABLE_SSE2=ON \ |
91 | %endif | |
92 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ | |
93 | %if %{with xine} | |
94 | -DWITH_XINE=ON \ | |
95 | %endif | |
96 | -DWITH_GSTREAMER=OFF \ | |
97 | -DWITH_1394=ON \ | |
98 | -DWITH_FFMPEG=ON \ | |
99 | -DWITH_GTK=ON \ | |
4bd2eae7 | 100 | -DWITH_V4L=ON \ |
95daeb66 | 101 | ../ |
54551f29 | 102 | |
95daeb66 AM |
103 | %{__make} \ |
104 | VERBOSE=1 | |
901927d3 AM |
105 | |
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
95daeb66 | 109 | %{__make} -C build install \ |
901927d3 AM |
110 | DESTDIR=$RPM_BUILD_ROOT |
111 | ||
4bd2eae7 AM |
112 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} |
113 | install build/unix-install/opencv.pc $RPM_BUILD_ROOT%{_pkgconfigdir} | |
114 | ||
9175d525 AM |
115 | %if %{_lib} = "lib64" |
116 | # upstream has no lib64 support | |
117 | mv $RPM_BUILD_ROOT%{_prefix}/lib/lib*.so* $RPM_BUILD_ROOT%{_libdir} | |
118 | %endif | |
119 | ||
901927d3 AM |
120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %post -p /sbin/ldconfig | |
124 | %postun -p /sbin/ldconfig | |
125 | ||
126 | %files | |
127 | %defattr(644,root,root,755) | |
901927d3 AM |
128 | %attr(755,root,root) %{_bindir}/* |
129 | %attr(755,root,root) %{_libdir}/lib*so.*.* | |
4bd2eae7 AM |
130 | %dir %{_datadir}/opencv |
131 | %{_datadir}/opencv/doc | |
132 | %{_datadir}/opencv/haarcascades | |
133 | %{_datadir}/opencv/lbpcascades | |
901927d3 AM |
134 | |
135 | %files devel | |
136 | %defattr(644,root,root,755) | |
137 | %attr(755,root,root) %{_libdir}/lib*.so | |
901927d3 | 138 | %{_includedir}/opencv |
509c07dc | 139 | %{_includedir}/opencv2 |
4bd2eae7 | 140 | %{_datadir}/opencv/OpenCVConfig.cmake |
901927d3 AM |
141 | %{_pkgconfigdir}/*.pc |
142 | ||
4bd2eae7 AM |
143 | #%files static |
144 | #%defattr(644,root,root,755) | |
145 | #%{_libdir}/lib*.a | |
901927d3 AM |
146 | |
147 | %files -n python-opencv | |
148 | %defattr(644,root,root,755) | |
4bd2eae7 | 149 | %attr(755,root,root) %{py_sitedir}/cv.so |