updated to 2.4.9
[profile/ivi/opencv.git] / packaging / opencv.spec
1 #
2 # spec file for package opencv
3 #
4 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
16 #
17
18
19 %bcond_with ffmpeg
20
21 Name:           opencv
22 %define libname lib%{name}
23 %define soname  2_4
24 Version:        2.4.9
25 Release:        0
26 Summary:        Collection of algorithms for computer vision
27 License:        BSD-3-Clause
28 Group:          Development/Libraries/C and C++
29 Url:            http://%{name}.willowgarage.com/wiki/
30 Source0:        http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/%{version}/OpenCV-%{version}.tar.bz2
31 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
32 BuildRequires:  cmake
33 BuildRequires:  fdupes
34 #BuildRequires:  gstreamer-0_10-plugins-base-devel
35 BuildRequires: gstreamer-devel
36 BuildRequires:  libjpeg-devel
37 BuildRequires:  libtiff-devel
38 BuildRequires:  zlib-devel
39
40 %description
41 OpenCV means IntelĀ® Open Source Computer Vision Library. It is a collection of C
42 functions and a few C++ classes that implement some popular Image Processing and
43 Computer Vision algorithms.
44
45 %package -n %{libname}%{soname}
46 Summary:        Development files for using the OpenCV library
47 Group:          Development/Libraries/C and C++
48
49 %description -n %{libname}%{soname}
50 The Open Computer Vision Library is a collection of algorithms and sample code
51 for various computer vision problems. The library is compatible with IPL and
52 utilizes Intel Integrated Performance Primitives for better performance.
53
54 %package devel
55 Summary:        Development files for using the OpenCV library
56 Group:          Development/Libraries/C and C++
57 Requires:       %{libname}%{soname} = %{version}
58 Requires:       %{name} = %{version}
59
60 %description devel
61 This package contains the OpenCV C/C++ library and header files, as well as
62 documentation. It should be installed if you want to develop programs that will
63 use the OpenCV library.
64
65 %prep
66 %setup -qn OpenCV-%{version}
67
68 # Windows specific and with wrong end of line
69 rm -f doc/packaging.txt
70 chmod +x samples/c/build_all.sh
71 sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
72                  samples/c/latentsvmdetect.cpp \
73                  samples/gpu/hog.cpp \
74                  samples/python/camshift.py
75
76 %build
77 export CFLAGS="%{optflags}"
78 export CXXFLAGS="%{optflags}"
79 mkdir build
80 cd build
81 cmake -DCMAKE_BUILD_TYPE=Release \
82       -DCMAKE_INSTALL_PREFIX='%{_prefix}' \
83       -DCMAKE_SKIP_RPATH=ON \
84       -DBUILD_TESTS=OFF \
85       -DINSTALL_C_EXAMPLES=ON \
86       -DINSTALL_PYTHON_EXAMPLES=OFF \
87       -DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
88       -DENABLE_OMIT_FRAME_POINTER=OFF \
89       -DWITH_QT=OFF \
90       -DWITH_UNICAP=ON \
91       -DWITH_XINE=ON \
92        ..
93 make %{?_smp_mflags} VERBOSE=1
94
95 %install
96 cd build
97 make DESTDIR=%{?buildroot:%{buildroot}} install/fast
98 #mkdir -p %{buildroot}%{_docdir}
99 #mv %{buildroot}%{_datadir}/OpenCV/doc %{buildroot}%{_docdir}/%{name}-doc
100 #mv %{buildroot}%{_datadir}/OpenCV/samples %{buildroot}%{_docdir}/%{name}-doc/examples
101 #dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/python*/*.py
102 #dos2unix %{buildroot}%{_docdir}/%{name}-doc/examples/gpu/*.cpp
103 %fdupes -s %{buildroot}%{_docdir}/%{name}-doc/examples
104
105 %clean
106 rm -rf %{buildroot}
107
108 %post   -n %{libname}%{soname} -p /sbin/ldconfig
109
110 %postun -n %{libname}%{soname} -p /sbin/ldconfig
111
112 %files -n %{libname}%{soname}
113 %defattr(-, root, root, 0755)
114 %{_libdir}/lib*.so.*
115 %{_libdir}/lib*.a
116
117 %files -n %{name}
118 %defattr(0644, root, root, 0755)
119 %attr(0755, root, root) %{_bindir}/%{name}_*
120 %{_datadir}/OpenCV
121 %exclude %{_datadir}/OpenCV/OpenCVConfig*.cmake
122
123 %files devel
124 %defattr(0644, root, root, 0755)
125 %{_includedir}/opencv
126 %{_includedir}/opencv2
127 %{_libdir}/lib*.so
128 %{_libdir}/pkgconfig/%{name}.pc
129 %{_datadir}/OpenCV/OpenCVConfig*.cmake
130
131 #%files -n python-%{name}
132 #%defattr(0644, root, root, 0755)
133 #%{python_sitearch}/cv.py
134 #%{python_sitearch}/cv2.so
135
136 %changelog