File v4l2loopback.spec of Package v4l2loopback

#
# spec file for package 
#
# Copyright (c) 2013 SUSE LINUX Products 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.8.0
Release:        0
License:        GPL-2.0+
Summary:        A kernel module to create V4L2 loopback devices
Url:            https://github.com/umlaeute/v4l2loopback
Group:          System/Kernel
Source:         %{name}-%{version}.tar.bz2
BuildRequires:  %kernel_module_package_buildreqs
BuildRequires:  make gcc help2man
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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
Group:          Productivity/Multimedia/Other
Summary:        Utils for V4L2 loopback devices
%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 -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
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
%defattr(-,root,root,0755)
%attr(0755,root,root) %{_bindir}/v4l2loopback-ctl
%attr(0644,root,root) %{_mandir}/man1/v4l2loopback-ctl.1.gz

openSUSE Build Service is sponsored by