File tp_smapi-kmp.spec of Package tp_smapi-kmp

Name:           tp_smapi-kmp
Summary:        Kernel Modules implementing smapi on ThinkPads
Version:        0.43
Release:        0
License:        GPL-2.0+
Group:          System/Kernel
Url:            https://github.com/evgeni/tp_smapi
Source:         tp_smapi-%{version}.tar.bz2

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  kernel-source
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
BuildRequires:  -pesign
BuildRequires:  -pesign-obs-integration
BuildRequires:  libelf-devel
ExclusiveArch:  %ix86 x86_64

%suse_kernel_module_package -n tp_smapi kdump um xen -p %_sourcedir/preamble

%description
The tp_smapi kernel module exposes some features of the ThinkPad hardware/firmware via a sysfs interface.
Currently, the main implemented functionality is control of battery charging and extended battery status.
It also includes an improved version of the HDAPS driver. The underlying hardware interfaces are SMAPI
and direct access to the embedded controller.

%prep
%setup -n tp_smapi-%{version}

set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    krel=$(make -s -C /usr/src/linux-obj/%_target_cpu/$flavor kernelrelease)
    cd obj/$flavor
    make KVER=${krel} KSRC=/usr/src/linux KBUILD=/usr/src/linux-obj/%_target_cpu/$flavor M=$PWD/obj/$flavor HDAPS=1
    cd -
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD/obj/$flavor
done
cd source

%changelog
openSUSE Build Service is sponsored by