enabled gst
[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  3_0
24 Version:        3.0.0beta
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-devel
35 BuildRequires:  pkgconfig(gstreamer-video-1.0)
36 BuildRequires:  pkgconfig(gstreamer-app-1.0)
37 BuildRequires:  pkgconfig(gstreamer-riff-1.0)
38 BuildRequires:  pkgconfig(gstreamer-pbutils-1.0)
39 BuildRequires:  libjpeg-devel
40 BuildRequires:  libtiff-devel
41 BuildRequires:  zlib-devel
42 BuildRequires:  qt5-qtwidgets-devel
43 BuildRequires:  qt5-plugin-generic-evdev
44 BuildRequires:  qt5-plugin-imageformat-gif
45 BuildRequires:  qt5-plugin-platform-linuxfb
46 BuildRequires:  qt5-plugin-platform-offscreen
47 BuildRequires:  qt5-plugin-platform-minimalegl
48 BuildRequires:  qt5-plugin-platform-minimal
49 BuildRequires:  qt5-plugin-platform-eglfs
50 BuildRequires:  qt5-plugin-imageformat-jpeg
51 BuildRequires:  qt5-plugin-platforminputcontext-ibus
52 BuildRequires:  qt5-plugin-imageformat-ico
53 BuildRequires:  qt5-qttest-devel
54 BuildRequires:  qt5-qtconcurrent-devel
55 Requires: qt5-qtwidgets
56
57 %description
58 OpenCV means IntelĀ® Open Source Computer Vision Library. It is a collection of C
59 functions and a few C++ classes that implement some popular Image Processing and
60 Computer Vision algorithms.
61
62 %package -n %{libname}%{soname}
63 Summary:        Development files for using the OpenCV library
64 Group:          Development/Libraries/C and C++
65
66 %description -n %{libname}%{soname}
67 The Open Computer Vision Library is a collection of algorithms and sample code
68 for various computer vision problems. The library is compatible with IPL and
69 utilizes Intel Integrated Performance Primitives for better performance.
70
71 %package devel
72 Summary:        Development files for using the OpenCV library
73 Group:          Development/Libraries/C and C++
74 Requires:       %{libname}%{soname} = %{version}
75 Requires:       %{name} = %{version}
76
77 %description devel
78 This package contains the OpenCV C/C++ library and header files, as well as
79 documentation. It should be installed if you want to develop programs that will
80 use the OpenCV library.
81
82 %prep
83 %setup -qn OpenCV-%{version}
84
85 # Windows specific and with wrong end of line
86 rm -f doc/packaging.txt
87 #chmod +x samples/c/build_all.sh
88 #sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
89 #                 samples/c/latentsvmdetect.cpp \
90 #                 samples/gpu/hog.cpp \
91 #                 samples/python/camshift.py
92
93 %build
94 export CFLAGS="%{optflags}"
95 export CXXFLAGS="%{optflags}"
96 mkdir build
97 cd build
98 cmake -DCMAKE_BUILD_TYPE=Release \
99       -DCMAKE_INSTALL_PREFIX='%{_prefix}' \
100       -DCMAKE_SKIP_RPATH=ON \
101       -DBUILD_TESTS=OFF \
102       -DINSTALL_C_EXAMPLES=ON \
103       -DINSTALL_PYTHON_EXAMPLES=OFF \
104       -DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
105       -DENABLE_OMIT_FRAME_POINTER=OFF \
106       -DWITH_QT=ON \
107       -DWITH_UNICAP=ON \
108       -DWITH_XINE=ON \
109       -DWITH_OPENGL=ON \
110       -DENABLE_SSE2=ON \
111       -DENABLE_SSE3=ON \
112       -DENABLE_SSE41=ON \
113       -DENABLE_SSE42=ON \
114       -DENABLE_SSSE3=ON \
115       -DWITH_IPP=OFF \
116        ..
117
118 make %{?_smp_mflags} VERBOSE=1
119
120 %install
121 cd build
122 make DESTDIR=%{?buildroot:%{buildroot}} install/fast
123 %fdupes -s %{buildroot}%{_docdir}/%{name}-doc/examples
124
125 %clean
126 rm -rf %{buildroot}
127
128 %post   -n %{libname}%{soname} -p /sbin/ldconfig
129
130 %postun -n %{libname}%{soname} -p /sbin/ldconfig
131
132 %files -n %{libname}%{soname}
133 %manifest packaging/opencv.manifest
134 %defattr(-, root, root, 0755)
135 %{_libdir}/lib*.so.*
136 %{_libdir}/lib*.a
137
138 %files -n %{name}
139 %attr(0755, root, root) %{_bindir}/%{name}_*
140 %manifest packaging/opencv.manifest
141 %{_datadir}/OpenCV
142 %exclude %{_datadir}/OpenCV/OpenCVConfig*.cmake
143
144 %files devel
145 %manifest packaging/opencv.manifest
146 %{_includedir}/opencv
147 %{_includedir}/opencv2
148 %{_libdir}/lib*.so
149 %{_libdir}/pkgconfig/%{name}.pc
150 %{_datadir}/OpenCV/OpenCVConfig*.cmake
151
152 %changelog