From 136e954fedfc666ac1ed2190492ea312a867bd7d Mon Sep 17 00:00:00 2001 From: Tae-Young Chung Date: Thu, 15 Apr 2021 22:47:44 +0900 Subject: [PATCH] Exclude python3-opencv from TV profile In TV profile, python3-numpy-devel isn't provided, which is mandatory for python3-opencv. So, it is excluded from TV profile. Change-Id: I8c82a3dbf4d9d0723563e73dfe7def9182e9abe7 Signed-off-by: Tae-Young Chung --- packaging/opencv.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packaging/opencv.spec b/packaging/opencv.spec index 2c0c875f68..300b029e0d 100644 --- a/packaging/opencv.spec +++ b/packaging/opencv.spec @@ -1,7 +1,7 @@ Name: opencv Summary: OpenCV library Version: 4.5.0 -Release: 1 +Release: 2 Group: Development/Libraries License: Apache-2.0 and BSD-3-Clause Source0: %{name}-%{version}.tar.gz @@ -26,8 +26,10 @@ BuildRequires: libavcodec-devel BuildRequires: libavformat-devel BuildRequires: libswscale-devel #support python3 +%if "%{?profile}" != "tv" BuildRequires: python3-devel BuildRequires: python3-numpy-devel +%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -43,6 +45,7 @@ Requires: %{name} = %{version}-%{release} %description devel The Open Computer Vision Library (Dev) includes various algorithms for computer vision problems. +%if "%{?profile}" != "tv" %package -n python3-opencv Summary: OpenCV Python3 Library Group: Development/Libraries @@ -50,6 +53,7 @@ Requires: %{name} = %{version}-%{release} %description -n python3-opencv The Open Computer Vision Library (Python3) includes various algorithms for computre vision problems. +%endif %prep %setup -q @@ -75,7 +79,6 @@ ARCH=i386 # compatibility to opencv3 sed -i 's/opencv4.pc/opencv.pc/g' cmake/OpenCVGenPkgconfig.cmake - mkdir -p build cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ @@ -99,7 +102,11 @@ cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_opencv_objdetect=ON \ -DBUILD_opencv_photo=ON \ -DBUILD_opencv_python2=OFF \ +%if "%{?profile}" != "tv" -DBUILD_opencv_python3=ON \ +%else + -DBUILD_opencv_python3=OFF \ +%endif -DBUILD_opencv_shape=OFF \ -DBUILD_opencv_stitching=OFF \ -DBUILD_opencv_superres=OFF \ @@ -301,9 +308,11 @@ fi %exclude /usr/share/opencv4/lbpcascades/*silverware* %exclude /usr/share/opencv4/*.supp +%if "%{?profile}" != "tv" %files -n python3-opencv %{python3_sitearch}/cv2/*.py %{python3_sitearch}/cv2/*/*.so +%endif %files devel /usr/include/* -- 2.34.1