Skip to content

Commit

Permalink
add: kmod-v4l2loopback
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Oct 22, 2024
1 parent 5b770c6 commit 92f8571
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
5 changes: 5 additions & 0 deletions anda/fusion/kmod-v4l2loopback/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "kmod-v4l2loopback.spec"
}
}
60 changes: 60 additions & 0 deletions anda/fusion/kmod-v4l2loopback/kmod-v4l2loopback.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# https://github.com/rpmfusion/v4l2loopback-kmod/blob/el7/v4l2loopback-kmod.spec
%if 0%{?fedora}
%global buildforkernels akmod
%global debug_package %nil
%endif

Name: v4l2loopback-kmod
Summary: v4l2-loopback kernel module
Version: 0.13.2
Release: 1%?dist
License: GPL-2.0-or-later

URL: https://github.com/umlaeute/v4l2loopback
Source0: %url/archive/v%version/v4l2loopback-%version.tar.gz

BuildRequires: gcc
BuildRequires: elfutils-libelf-devel
BuildRequires: kmodtool
BuildRequires: mold
# %{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%buildforkernels}%!?buildforkernels:current-%_target_cpu}

# kmodtool does its magic here
%{expand:%(kmodtool --target %_target_cpu --repo terra --kmodname v4l2loopback %{?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.

This package contains the kmod module for v4l2loopback.


%prep
# error out if there was something wrong with kmodtool
%?kmodtool_check

# print kmodtool output for debugging purposes:
kmodtool --target %_target_cpu --repo rpmfusion --kmodname v4l2loopback %{?buildforkernels:--%buildforkernels} %{?kernels:--for-kernels "%?kernels"} 2>/dev/null

%autosetup -n v4l2loopback-%version

for kernel_version in %?kernel_versions ; do
cp -a v4l2loopback-%version _kmod_build_${kernel_version%%___*}
done


%build
for kernel_version in %?kernel_versions ; do
mold -run make V=1 %?_smp_mflags -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} modules
done


%install
for kernel_version in %?kernel_versions; do
mkdir -p %{buildroot}%kmodinstdir_prefix/${kernel_version%%___*}/%kmodinstdir_postfix/
install -Dm755 _kmod_build_${kernel_version%%___*}/v4l2loopback.ko %buildroot%kmodinstdir_prefix/${kernel_version%%___*}/%kmodinstdir_postfix/
chmod a+x %buildroot%kmodinstdir_prefix/${kernel_version%%___*}/%kmodinstdir_postfix/*.ko
done
%?akmod_install
1 change: 1 addition & 0 deletions anda/fusion/kmod-v4l2loopback/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm.version(gh_tag("umlaeute/v4l2loopback"));

0 comments on commit 92f8571

Please sign in to comment.