File v4l2loopback.spec of Package v4l2loopback

#
# spec file for package v4l2loopback
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           v4l2loopback
Version:        0.11.0
Release:        0
Summary:        A kernel module to create V4L2 loopback devices
License:        GPL-2.0-or-later
Group:          System/Kernel
Url:            https://github.com/umlaeute/v4l2loopback
Source:         https://github.com/umlaeute/v4l2loopback/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        preamble
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  gcc
BuildRequires:  help2man
BuildRequires:  make
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
Group:          Productivity/Multimedia/Other

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

%prep
%setup -q
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 %{?_smp_mflags} -C %{kernel_source $flavor} 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 -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
	make -C obj/$flavor install-utils DESTDIR=%{?buildroot:%{buildroot}} PREFIX=%{_prefix}
	make -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