1 Star 0 Fork 23

luoyang / opencv_1

forked from src-openEuler / opencv 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
opencv.spec 4.31 KB
一键复制 编辑 原始数据 按行查看 历史
shenwei41 提交于 2022-11-05 11:41 . fix cve
Name: opencv
Version: 4.5.2
Release: 7
Summary: OpenCV means Intel® Open Source Computer Vision Library.
License: Apache-2.0
URL: https://github.com/opencv/opencv
Source0: %{name}-%{version}.tar.gz
Source1: %{name}_extra-%{version}.tar.gz
Source2: opencv_extra-4.5.2.tar.gz.aa
Source3: opencv_extra-4.5.2.tar.gz.ab
Source4: opencv_extra-4.5.2.tar.gz.ac
Source5: opencv_extra-4.5.2.tar.gz.ad
Source6: opencv_extra-4.5.2.tar.gz.ae
Patch1: Fix-OpenCV-build-with-OpenEXR-before-2.2.0.patch
Patch2: Fix_compilation_of_copy_assignment_operators_with_GCC.patch
Patch3: Repair_clang_abi.patch
Patch4: CVE-2022-0561_and_CVE-2022-0562.patch
Patch5: CVE-2022-0908.patch
BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf
BuildRequires: cmake
BuildRequires: python3-numpy python3-devel
%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
cat %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} > %{SOURCE1}
%autosetup -p1 -n %{name}-%{version}
tar -xvf %{SOURCE1} -C .
pwd
%build
mkdir -p cmake/build
cd cmake/build
cmake ../../ -DCMAKE_BUILD_TYPE=Release\
-DWITH_PROTOBUF=OFF\
-DWITH_WEBP=OFF\
-DWITH_IPP=OFF\
-DWITH_ADE=OFF\
-DBUILD_ZLIB=ON\
-DBUILD_JPEG=ON\
-DBUILD_PNG=ON\
-DBUILD_OPENEXR=ON\
-DBUILD_TESTS=ON\
-DBUILD_PERF_TESTS=OFF\
-DBUILD_opencv_apps=OFF\
-DBUILD_opencv_python3=ON\
-DBUILD_opencv_python2=OFF\
-DBUILD_opencv_java=OFF\
-DWITH_FFMPEG=OFF\
-DWITH_TIFF=ON\
-DBUILD_TIFF=OFF\
-DWITH_JASPER=OFF\
-DBUILD_JASPER=OFF\
-DBUILD_SHARED_LIBS=ON\
-DBUILD_EXAMPLES=ON\
-DOPENCV_TEST_DATA_PATH=%_builddir/%{name}-%{version}/opencv_extra-%{version}/testdata\
-DINSTALL_TESTS=ON\
-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 -j24 V=1
ctest -E "opencv_test_objdetect|opencv_test_photo"
%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
* 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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luoyang42/opencv_1.git
git@gitee.com:luoyang42/opencv_1.git
luoyang42
opencv_1
opencv_1
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891