summaryrefslogtreecommitdiff
path: root/opencv.spec
blob: 87491e4079b22b8f9759531b92737738d8629e8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Name:		opencv
Version:	4.13.0
Release:	1
Summary:	OpenCV means IntelĀ® Open Source Computer Vision Library.
License:	Apache-2.0
URL:		https://github.com/opencv/opencv
Source0:	https://github.com/opencv/opencv/archive/refs/tags/%{version}.tar.gz

BuildRequires:  qt5-qtbase-devel
BuildRequires:	gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf
BuildRequires:  cmake
BuildRequires:  python3-numpy python3-devel
BuildRequires:  tesseract-devel
BuildRequires:  mesa-libGLU-devel
BuildRequires:  java-1.8.0-openjdk

%description
OpenCV means IntelĀ® Open Source Computer Vision Library. It is a collection of
C functions and a few C++ classes that implement some popular Image Processing
and Computer Vision algorithms.

%global debug_package %{nil}

%prep
%autosetup -n %{name}-%{version}

%build
mkdir -p cmake/build
cd cmake/build
cmake ../../ -DCMAKE_BUILD_TYPE=Release\
             -DWITH_PROTOBUF=ON\
             -DWITH_WEBP=ON\
             -DWITH_IPP=OFF\
             -DWITH_ADE=OFF\
             -DBUILD_ZLIB=ON\
             -DBUILD_JPEG=ON\
             -DBUILD_PNG=ON\
             -DBUILD_OPENEXR=ON\
             -DBUILD_TESTS=OFF\
             -DBUILD_PERF_TESTS=OFF\
             -DBUILD_opencv_apps=OFF\
             -DWITH_CUDA=OFF\
             -DBUILD_JAVA=ON\
             -DBUILD_opencv_dnn=ON\
             -DBUILD_opencv_face=ON\
             -DBUILD_opencv_python3=ON\
             -DBUILD_opencv_python2=OFF\
             -DBUILD_opencv_java=ON\
             -DWITH_GTK=OFF\
             -DWITH_OPENGL=ON\
             -DWITH_FFMPEG=OFF\
             -DWITH_TIFF=ON\
             -DWITH_QT=5\
             -DBUILD_TIFF=OFF\
             -DWITH_JASPER=OFF\
             -DBUILD_JASPER=OFF\
             -DBUILD_SHARED_LIBS=ON\
             -DBUILD_EXAMPLES=OFF\
             -DINSTALL_TESTS=OFF\
             -DPYTHON3_EXECUTABLE=$(which python3)\
             -DPYTHON_EXECUTABLE=$(which python3)\
             -DPYTHON_DEFAULT_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")\
             -DPYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print (numpy.get_include())")\
             -DPYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")\
             -DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")\
             -DPYTHON3_LIBRARIES=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\
             -DPYTHON3_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\
             -DPYTHON_LIBRARIES=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\
             -DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\
             -DCMAKE_INSTALL_PREFIX=/usr \
             -DOPENCV_CONFIG_INSTALL_PATH=%{_lib}/cmake/OpenCV \
             -DOPENCV_GENERATE_PKGCONFIG=ON
make -j$(nproc) V=1

%install
cd cmake/build
make install DESTDIR=%{buildroot}

%files
%defattr(-,root,root)
%exclude /usr/bin/setup_vars_opencv4.sh
%{_bindir}/*
%{_libdir}/*
%{_includedir}/*
%exclude /usr/share/*
%{python3_sitelib}/cv2/*

%changelog
* Tue Mar 25 2025 Claude Code <noreply@anthropic.com> - 4.13.0-1
- Upgrade to 4.13.0
- Remove all patches (fixed upstream):
  - CVE-2022-0561_and_CVE-2022-0562.patch (libtiff CVE fixed)
  - CVE-2022-0908.patch (libtiff CVE fixed)
  - Fix-OpenCV-build-with-OpenEXR-before-2.2.0.patch (merged)
  - Fix_compilation_of_copy_assignment_operators_with_GCC.patch (code improved)
  - Repair_clang_abi.patch (code restructured)
  - Merge-pull-request-21114-from-dwardor-patch-1.patch (OCV_LAPACK_FUNC merged)
  - calib3d-use-OCV_LAPACK_FUNC.patch (merged)
- Remove opencv_extra (not needed for BUILD_TESTS=OFF)
- Remove deprecated BUILD_opencv_dnn_modern option
- Use make -j$(nproc) for parallel build

* Wed Nov 22 2023 konglidong <konglidong@uniontech.com> - 4.5.2-9
- backport upstraem patch to fix build failed

* Sat May 06 2023 misaka00251 <liuxin@iscas.ac.cn> - 4.5.2-8
- Fix tests failed
- Add option to build DNN

* Thu Nov 05 2022 shenwei <shenwei41@huawei.com> - 4.5.2-7
- fix three cve bug of the opencv

* Thu Jan 28 2022 douyan <douyan@kylinos.cn> - 4.5.2-6
- add pkgconfig file

* Thu Jan 27 2022 douyan <douyan@kylinos.cn> - 4.5.2-5
- use %%{python3_sitelib} instead of /usr/lib/python3.8/site-packages

* Wed Nov 17 2021 shenwei <shenwei41@huawei.com> - 4.5.2-4
- repair Clang ABI

* Sat Nov 13 2021 shenwei <shenwei41@huawei.com> - 4.5.2-3
- fix compilation of copy ctors/assignment operators with GCC 4.x

* Wed Nov 10 2021 yanhailiang <yanhailiang@huawei.com> - 4.5.2-2
- bugFix OpenCV build with OpenEXR before 2.2.0

* Thu Sep 30 2021 shenwei <shenwei41@huawei.com> - 4.5.2-1
- package init