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
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
%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
%description -n python3-opencv
The Open Computer Vision Library (Python3) includes various algorithms for computre vision problems.
+%endif
%prep
%setup -q
# compatibility to opencv3
sed -i 's/opencv4.pc/opencv.pc/g' cmake/OpenCVGenPkgconfig.cmake
-
mkdir -p build
cd build
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 \
%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/*