feat(v4l2loopback): DKMS package (#3786) (#3841)

* Add files

* Waaaaaaaa

* Fixes

* Bruh

Signed-off-by: Gilver <rockgrub@disroot.org>

* No way they just changed the URL TODAY

* Should probably be that

Signed-off-by: Gilver <rockgrub@disroot.org>

* Only build noarch package once

* ??????????????????

* Also no

* Nevermind I guess

* Modules file source

---------

Signed-off-by: Gilver <rockgrub@disroot.org>
(cherry picked from commit 8f2ff70819)

Co-authored-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
Raboneko
2025-03-08 23:35:40 -08:00
committed by GitHub
parent 868c090402
commit f1db84f48d
13 changed files with 111 additions and 43 deletions
+1
View File
@@ -4,5 +4,6 @@ project pkg {
}
labels {
mock = 1
updbranch = 1
}
}
@@ -1 +0,0 @@
v4l2loopback
+3 -1
View File
@@ -1 +1,3 @@
rpm.version(gh_tag("umlaeute/v4l2loopback"));
import "andax/bump_extras.rhai" as bump;
rpm.version(bump::madoguchi("v4l2loopback", labels.branch));
@@ -7,38 +7,40 @@
%global buildforkernels akmod
%global debug_package %{nil}
%global commit 2c9b67072b15d903fecde67c7f269abeafee4c25
%global commitdate 20230503
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global modulename v4l2loopback
%global _description %{expand:
This module allows you to create \"virtual video devices.\" Normal \(v4l2\) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.}
Name: %{modulename}-kmod
Summary: Kernel module (kmod) for V4L2 loopback devices
Version: 0.14.0
Release: 2%?dist
License: GPLv2+
URL: https://github.com/umlaeute/v4l2loopback
License: GPL-2.0-or-later
URL: https://github.com/v4l2loopback/v4l2loopback
Source0: %{url}/archive/v%{version}/%{modulename}-%{version}.tar.gz
Source1: modprobe-d-98-v4l2loopback.conf
Source2: modules-load-d-v4l2loopback.conf
Packager: Cappy Ishihara <cappy@fyralabs.com>
BuildRequires: gcc
BuildRequires: make
BuildRequires: help2man
BuildRequires: systemd-rpm-macros
BuildRequires: kmodtool
Requires: akmods
Requires: %{modulename} = %{?epoch:%{epoch}:}%{version}
Requires: %{modulename}-akmod-modules = %{?epoch:%{epoch}:}%{version}
Requires: kernel-devel
Conflicts: dkms-%{modulename}
Packager: Cappy Ishihara <cappy@fyralabs.com>
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
This module allows you to create "virtual video devices". Normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.
%{expand:%(kmodtool --target %{_target_cpu} --repo terra --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description %_description
%prep
%{?kmodtool_check}
kmodtool --target %{_target_cpu} --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
kmodtool --target %{_target_cpu} --repo terra --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
%autosetup -p1 -n %{modulename}-%{version}
@@ -59,14 +61,5 @@ done
%{?akmod_install}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_modprobedir}/98-v4l2loopback.conf
install -D -m 0644 %{SOURCE2} %{buildroot}%{_modulesloaddir}/v4l2loopback.conf
%files
%doc README.md AUTHORS NEWS
%license COPYING
%{_modprobedir}/98-v4l2loopback.conf
%{_modulesloaddir}/v4l2loopback.conf
%changelog
%autochangelog
+10
View File
@@ -0,0 +1,10 @@
project pkg {
arches = ["x86_64"]
rpm {
spec = "dkms-v4l2loopback.spec"
}
labels {
mock = 1
updbranch = 1
}
}
@@ -0,0 +1,55 @@
%global debug_package %{nil}
%global modulename v4l2loopback
%global _description %{expand:
This module allows you to create \"virtual video devices.\" Normal \(v4l2\) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.}
Name: dkms-%{modulename}
Version: 0.14.0
Release: 1%?dist
Summary: Utils for V4L2 loopback devices
License: GPL-2.0-or-later
URL: https://github.com/v4l2loopback/v4l2loopback
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: no-weak-modules.conf
BuildRequires: systemd-rpm-macros
Requires: %{modulename} = %{?epoch:%{epoch}:}%{version}
Requires: dkms
Conflicts: akmod-%{modulename}
BuildArch: noarch
Packager: Gilver E. <rockgrub@disroot.org>
%description %_description
%prep
%autosetup -p1 -n %{modulename}-%{version}
%build
%install
mkdir -p %{buildroot}%{_usrsrc}/%{modulename}-%{version}
cp -fr v4l2loopback.h v4l2loopback.c v4l2loopback_formats.h dkms.conf Kbuild Makefile %{buildroot}%{_usrsrc}/%{modulename}-%{version}/
%if 0%{?fedora}
# Do not enable weak modules support in Fedora (no kABI):
install -Dpm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/dkms/%{modulename}.conf
%endif
%post
dkms add -m %{modulename} -v %{version} -q --rpm_safe_upgrade || :
# Rebuild and make available for the currently running kernel:
dkms build -m %{modulename} -v %{version} -q || :
dkms install -m %{modulename} -v %{version} -q --force || :
%preun
# Remove all versions from DKMS registry:
dkms remove -m %{modulename} -v %{version} -q --all --rpm_safe_upgrade || :
%files
%{_usrsrc}/%{modulename}-%{version}
%if 0%{?fedora}
%{_sysconfdir}/dkms/%{modulename}.conf
%endif
%changelog
* Fri Mar 07 2025 Gilver E. <rockgrub@disroot.org>
- Initial package
@@ -0,0 +1 @@
NO_WEAK_MODULES="yes"
@@ -0,0 +1,3 @@
import "andax/bump_extras.rhai" as bump;
rpm.version(bump::madoguchi("v4l2loopback", labels.branch));
@@ -1,8 +1,6 @@
project pkg {
arches = ["x86_64", "aarch64"]
rpm {
spec = "v4l2loopback.spec"
}
labels {
mock = 1
}
}
@@ -0,0 +1 @@
rpm.version(gh_tag("v4l2loopback/v4l2loopback"));
@@ -1,6 +1,4 @@
%global buildforkernels akmod
%global debug_package %{nil}
%global commit 2c9b67072b15d903fecde67c7f269abeafee4c25
%global commitdate 20230503
%global shortcommit %(c=%{commit}; echo ${c:0:7})
@@ -8,48 +6,53 @@
Name: v4l2loopback
Summary: Utils for V4L2 loopback devices
Version: 0.14.0
Release: 2%?dist
License: GPLv2+
URL: https://github.com/umlaeute/v4l2loopback
Release: 3%?dist
License: GPL-2.0-or-later
URL: https://github.com/v4l2loopback/v4l2loopback
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Packager: Cappy Ishihara <cappy@fyralabs.com>
Source1: modprobe-d-98-v4l2loopback.conf
BuildRequires: gcc
BuildRequires: make
BuildRequires: help2man
BuildRequires: sed
BuildRequires: systemd-rpm-macros
BuildRequires: kmodtool
BuildRequires: systemd-rpm-macros
Requires: %{name}-kmod
Provides: %{name}-kmod-common = %{version}-%{release}
Requires: (akmod-%{name} = %{?epoch:%{epoch}:}%{version} or dkms-%{name} = %{?epoch:%{epoch}:}%{version})
Provides: %{name}-kmod-common = %{?epoch:%{epoch}:}%{version}
### For compatibility with older names
Provides: %{name}-utils = %{version}-%{release}
Obsoletes: %{name}-utils < 0.12.5-2
Packager: Cappy Ishihara <cappy@fyralabs.com>
%description
Allows you to create "virtual video devices". Normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application.
%package akmod-modules
Summary: Modules for Akmods
Requires: akmod-%{name}
BuildArch: noarch
%description akmod-modules
Akmods modules for the akmod-%{name} package.
%prep
%autosetup -p1 -n %{name}-%{version}
%build
/usr/bin/sed -nE '/^PACKAGE_NAME/{s@^.+"(.+)"@\1@; s|-|_|g; p}' dkms.conf > %{name}.conf
%build
%{set_build_flags}
%make_build utils
%install
%{set_build_flags}
%make_build utils
make V=1 %{?_smp_mflags} install-utils DESTDIR=%{buildroot} PREFIX=%{_prefix}
make V=1 %{?_smp_mflags} install-man DESTDIR=%{buildroot} PREFIX=%{_prefix}
install -Dm644 %{SOURCE1} %{buildroot}%{_modprobedir}/98-v4l2loopback.conf
install -Dm644 %{name}.conf -t %{buildroot}%{_modulesloaddir}
%files
@@ -57,7 +60,10 @@ make V=1 %{?_smp_mflags} install-man DESTDIR=%{buildroot} PREFIX=%{_prefix}
%license COPYING
%attr(0755,root,root) %{_bindir}/v4l2loopback-ctl
%attr(0644,root,root) %{_mandir}/man1/v4l2loopback-ctl.1*
%{_modprobedir}/98-v4l2loopback.conf
%files akmod-modules
%{_modulesloaddir}/v4l2loopback.conf
%changelog
%autochangelog
-1
View File
@@ -1 +0,0 @@
rpm.version(gh_tag("umlaeute/v4l2loopback"));