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