File v4l2loopback.spec of Package v4l2loopback.13737

#
# spec file for package v4l2loopback
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           v4l2loopback
Version:        0.12.5
Release:        0
Summary:        A kernel module to create V4L2 loopback devices
License:        GPL-2.0-or-later
URL:            https://github.com/umlaeute/v4l2loopback
Source:         https://github.com/umlaeute/v4l2loopback/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        preamble
# PATCH-FIX-OPENSUSE v4l2loopback-include_header.patch
Patch0:         v4l2loopback-include_header.patch
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  help2man
Requires:       v4l-utils
%kernel_module_package -p %{_sourcedir}/preamble

%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.

%package utils
Summary:        Utils for V4L2 loopback devices

%description utils
v4l2loopback-ctl for controlling FPS, placeholder image and image format.

%prep
%autosetup
set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
for flavor in %{flavors_to_build}; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	make V=1 %{?_smp_mflags} -C %{kernel_source $flavor} %{?linux_make_arch} modules M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR='%{kernel_module_package_moddir}'
for flavor in %{flavors_to_build}; do
	make V=1 -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
	make V=1 -C obj/$flavor install-utils DESTDIR=%{?buildroot:%{buildroot}} PREFIX=%{_prefix}
	make V=1 -C obj/$flavor install-man DESTDIR=%{?buildroot:%{buildroot}} PREFIX=%{_prefix}
done

%files utils
%attr(0755,root,root) %{_bindir}/v4l2loopback-ctl
%attr(0644,root,root) %{_mandir}/man1/v4l2loopback-ctl.1.gz

%changelog
openSUSE Build Service is sponsored by