diff --git a/0001-utils-v4l2-TPG-Update-use-of-typeof.patch b/0001-utils-v4l2-TPG-Update-use-of-typeof.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6b61d3a86d4e7975d72913567a0a0f063a838b7 --- /dev/null +++ b/0001-utils-v4l2-TPG-Update-use-of-typeof.patch @@ -0,0 +1,51 @@ +From 9f799271e5e92cb84cbce002896ce7c25dad4fd8 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Mon, 27 Dec 2021 15:25:21 +0000 +Subject: [PATCH] utils: v4l2 TPG: Update use of typeof + +It seems the way to use typeof with newer gcc's is by using +__typeof__ + +Signed-off-by: Peter Robinson +--- + utils/common/v4l2-tpg.h | 6 +++--- + utils/common/v4l2-tpg.patch | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/utils/common/v4l2-tpg.h b/utils/common/v4l2-tpg.h +index ecdb6eba..ba351c28 100644 +--- a/utils/common/v4l2-tpg.h ++++ b/utils/common/v4l2-tpg.h +@@ -46,9 +46,9 @@ static inline void *vzalloc(unsigned long size) + } + + #define clamp(val, min, max) ({ \ +- typeof(val) __val = (val); \ +- typeof(min) __min = (min); \ +- typeof(max) __max = (max); \ ++ __typeof__(val) __val = (val); \ ++ __typeof__(min) __min = (min); \ ++ __typeof__(max) __max = (max); \ + (void) (&__val == &__min); \ + (void) (&__val == &__max); \ + __val = __val < __min ? __min: __val; \ +diff --git a/utils/common/v4l2-tpg.patch b/utils/common/v4l2-tpg.patch +index 2381ebd9..d7edc1f3 100644 +--- a/utils/common/v4l2-tpg.patch ++++ b/utils/common/v4l2-tpg.patch +@@ -214,9 +214,9 @@ index 0b0ddb87..91da74ec 100644 + +} + + + +#define clamp(val, min, max) ({ \ +-+ typeof(val) __val = (val); \ +-+ typeof(min) __min = (min); \ +-+ typeof(max) __max = (max); \ +++ __typeof__(val) __val = (val); \ +++ __typeof__(min) __min = (min); \ +++ __typeof__(max) __max = (max); \ + + (void) (&__val == &__min); \ + + (void) (&__val == &__max); \ + + __val = __val < __min ? __min: __val; \ +-- +2.33.1 + diff --git a/v4l-utils-1.22.1.tar.bz2 b/v4l-utils-1.22.1.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..a5fb0b7d2d3b710d95701e8411dfc269540b8bfc Binary files /dev/null and b/v4l-utils-1.22.1.tar.bz2 differ diff --git a/v4l-utils.spec b/v4l-utils.spec new file mode 100644 index 0000000000000000000000000000000000000000..26f365a70f57b97b968e69b3090e362b694057e3 --- /dev/null +++ b/v4l-utils.spec @@ -0,0 +1,207 @@ +%define anolis_release 1 +Name: v4l-utils +Version: 1.22.1 +Release: %{anolis_release}%{?dist} +Summary: Utilities for video4linux and DVB devices +# libdvbv5, dvbv5 utils, ir-keytable and v4l2-sysfs-path are GPLv2 only +License: GPLv2+ and GPLv2 +URL: http://www.linuxtv.org/downloads/v4l-utils/ + +Source0: http://linuxtv.org/downloads/v4l-utils/v4l-utils-%{version}.tar.bz2 +Patch1: 0001-utils-v4l2-TPG-Update-use-of-typeof.patch + +BuildRequires: alsa-lib-devel +BuildRequires: desktop-file-utils +BuildRequires: doxygen +BuildRequires: gettext +BuildRequires: kernel-headers +BuildRequires: libjpeg-devel +BuildRequires: make +BuildRequires: qt5-qtbase-devel +BuildRequires: systemd-devel + +# BPF decoder dependencies +%define with_bpf 1 + +%if %{with_bpf} +BuildRequires: elfutils-libelf-devel clang +%endif + +# For /lib/udev/rules.d ownership +Requires: systemd-udev +Requires: libv4l = %{version}-%{release} + +%description +v4l-utils is a collection of various video4linux (V4L) and DVB utilities. The +main v4l-utils package contains cx18-ctl, ir-keytable, ivtv-ctl, v4l2-ctl and +v4l2-sysfs-path. + + +%package devel-tools +Summary: Utilities for v4l2 / DVB driver development and debugging +# decode_tm6000 is GPLv2 only +License: GPLv2+ and GPLv2 +Requires: libv4l = %{version}-%{release} + +%description devel-tools +Utilities for v4l2 / DVB driver authors: decode_tm6000, v4l2-compliance and +v4l2-dbg. + + +%package -n qv4l2 +Summary: QT v4l2 test control and streaming test application +License: GPLv2+ +Requires: libv4l = %{version}-%{release} + +%description -n qv4l2 +QT v4l2 test control and streaming test application. + + +%package -n libv4l +Summary: Collection of video4linux support libraries +# Some of the decompression helpers are GPLv2, the rest is LGPLv2+ +License: LGPLv2+ and GPLv2 +URL: http://hansdegoede.livejournal.com/3636.html + +%description -n libv4l +libv4l is a collection of libraries which adds a thin abstraction layer on +top of video4linux2 devices. The purpose of this (thin) layer is to make it +easy for application writers to support a wide variety of devices without +having to write separate code for different devices in the same class. libv4l +consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2. + +libv4lconvert offers functions to convert from any (known) pixel-format +to V4l2_PIX_FMT_BGR24 or V4l2_PIX_FMT_YUV420. + +libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent +of the drivers for those devices supporting v4l1 compatibility (which many +v4l2 drivers do not). + +libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the +application transparent libv4lconvert conversion where necessary. + + +%package -n libdvbv5 +Summary: Libraries to control, scan and zap on Digital TV channels +License: GPLv2 + +%description -n libdvbv5 +Libraries to control, scan and zap on Digital TV channels + + +%package -n libv4l-devel +Summary: Development files for libv4l +License: LGPLv2+ +URL: http://hansdegoede.livejournal.com/3636.html +Requires: libv4l = %{version}-%{release} + +%description -n libv4l-devel +The libv4l-devel package contains libraries and header files for +developing applications that use libv4l. + + +%package -n libdvbv5-devel +Summary: Development files for libdvbv5 +License: GPLv2 +Requires: libdvbv5 = %{version}-%{release} + +%description -n libdvbv5-devel +The libdvbv5-devel package contains libraries and header +files for developing applications that use libdvbv5. + + +%prep +%autosetup -p1 + +%build +export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" +%configure --disable-static --enable-libdvbv5 --enable-doxygen-man +# Don't use rpath! +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +%make_build +make doxygen-run + + +%install +%make_install +find $RPM_BUILD_ROOT -name '*.la' -delete +rm -f $RPM_BUILD_ROOT%{_libdir}/{v4l1compat.so,v4l2convert.so} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3/ +cp -arv %{_builddir}/%{name}-%{version}/doxygen-doc/man/man3 $RPM_BUILD_ROOT%{_mandir}/ +rm $RPM_BUILD_ROOT%{_mandir}/man3/_*3 +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/qv4l2.desktop +%find_lang %{name} +%find_lang libdvbv5 + + +%ldconfig_scriptlets -n libv4l + +%ldconfig_scriptlets -n libdvbv5 + +%files -f %{name}.lang +%doc README +%dir %{_sysconfdir}/rc_keymaps +%config(noreplace) %{_sysconfdir}/rc_maps.cfg +%{_udevrulesdir}/70-infrared.rules +%{_udevrulesdir}/../rc_keymaps/* +%{_bindir}/cx18-ctl +%{_bindir}/cec* +%{_bindir}/dvb* +%{_bindir}/ir-ctl +%{_bindir}/ir-keytable +%{_bindir}/ivtv-ctl +%{_bindir}/media-ctl +%{_bindir}/rds-ctl +%{_bindir}/v4l2-ctl +%{_bindir}/v4l2-sysfs-path +%{_mandir}/man1/*.1* +%{_mandir}/man5/*.5* +%exclude %{_mandir}/man1/qv4l2.1* +%exclude %{_mandir}/man1/v4l2-compliance.1* + +%files devel-tools +%doc README +%{_bindir}/decode_tm6000 +%{_bindir}/v4l2-compliance +%{_mandir}/man1/v4l2-compliance.1* +%{_sbindir}/v4l2-dbg + +%files -n qv4l2 +%doc README +%{_bindir}/qv4l2 +%{_bindir}/qvidcap +%{_datadir}/applications/qv4l2.desktop +%{_datadir}/applications/qvidcap.desktop +%{_datadir}/icons/hicolor/*/apps/qv4l2.* +%{_datadir}/icons/hicolor/*/apps/qvidcap.* +%{_mandir}/man1/qv4l2.1* +%{_mandir}/man1/qvidcap.1* + +%files -n libv4l +%doc ChangeLog README.libv4l TODO +%license COPYING.libv4l COPYING +%{_libdir}/libv4l +%{_libdir}/libv4l*.so.* + +%files -n libv4l-devel +%doc README.lib-multi-threading +%{_includedir}/libv4l*.h +%{_libdir}/libv4l*.so +%{_libdir}/pkgconfig/libv4l*.pc + +%files -n libdvbv5 -f libdvbv5.lang +%doc ChangeLog lib/libdvbv5/README +%license COPYING +%{_libdir}/libdvbv5*.so.* + +%files -n libdvbv5-devel +%{_includedir}/libdvbv5/*.h +%{_libdir}/libdvbv5*.so +%{_libdir}/pkgconfig/libdvbv5*.pc +%{_mandir}/man3/*.3* + + +%changelog +* Thu Apr 14 2022 Chunmei Xu - 1.22.1-1 +- init from upstream