File i2c-openrgb-kmp.spec of Package i2c-openrgb-kmp

#
# spec file for package i2c-openrgb-kmp
#
# Copyright (c) 2020 sp1rit <sp1ritCS@protonmail.com>
# 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/
#

%define kversion %(uname -r)

Name:           i2c-openrgb-kmp
Version:        0
Release:        0
Summary:       	I2C patches for OpenRGB
Group:			System/Kernel
License:        GPL-2.0
URL:            https://gitlab.com/CalcProgrammer1/OpenRGB
Source99:		preamble
Source100:		LICENSE
Patch0:			OpenRGB.patch
Patch1:			driver_includes.patch
BuildRequires:  kernel-source kernel-syms module-init-tools
%suse_kernel_module_package -n i2c-openrgb -p %_sourcedir/preamble kdump um

%description


%prep
cp -r /usr/src/linux/drivers/i2c/ %{_builddir}/%{name}-%{version}
%autosetup -p1 -n %{_builddir}/%{name}-%{version} -T -D
cp %SOURCE100 .

%build
for flavor in %flavors_to_build; do
  rm -rf obj/$flavor
  mkdir -p obj/$flavor/
  cp -r Makefile Kconfig i2c* algos/ busses/ muxes/ "/usr/src/linux-$(echo $(uname -r) | sed 's/-[0-9a-z]\+$//')/drivers/"{gpio/gpiolib.h,pinctrl/core.h} obj/$flavor/
  make %{?_smp_mflags} kdir=/lib/modules/%{kversion}/build -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
# needssslcertforbuild
export BRP_PESIGN_FILES='*.ko'
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%{_target_cpu}/$flavor modules_install \
    M=$PWD/obj/$flavor
done

%files
%license LICENSE
%defattr(-,root,root)
%dir /lib/modules/%{kversion}

%changelog
openSUSE Build Service is sponsored by