Files
packages/anda/system/v4l2loopback/akmod/v4l2loopback-kmod.spec
Raboneko f1db84f48d 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>
2025-03-09 15:35:40 +08:00

66 lines
2.6 KiB
RPMSpec

# The reason why this package is a separate from the main one despite using the same sources
# is because akmods use the srpm to build the kmod package, and if the kmod package is included
# in the main package, akmods will reinstall the userspace package every time the kernel is updated.
# I made the mistake of combining the specs when I ported this from RPMFusion, but to be fair
# they barely document anything.
%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: GPL-2.0-or-later
URL: https://github.com/v4l2loopback/v4l2loopback
Source0: %{url}/archive/v%{version}/%{modulename}-%{version}.tar.gz
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} --repo terra --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description %_description
%prep
%{?kmodtool_check}
kmodtool --target %{_target_cpu} --repo terra --kmodname %{modulename} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
%autosetup -p1 -n %{modulename}-%{version}
%build
for kernel_version in %{?kernel_versions} ; do
make V=1 %{?_smp_mflags} M=${PWD}/_kmod_build_${kernel_version%%___*} VERSION=v%{version} v4l2loopback
done
%install
for kernel_version in %{?kernel_versions}; do
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
install -D -m 755 v4l2loopback.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko
done
%{?akmod_install}
%changelog
%autochangelog