File acpi_call.spec of Package acpi_call
#
# spec file for package acpi_call
#
# Copyright (c) 2022 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: acpi_call
Version: 1.2.2
Release: 0
Summary: The acpi-call kernel module
License: GPL-3.0-or-later
Group: System/Kernel
URL: https://github.com/nix-community/acpi_call
Source: %{name}-%{version}.tar.gz
BuildRequires: %{kernel_module_package_buildreqs}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%kernel_module_package
%description
A kernel simple module that enables you to call ACPI methods by writing the
method name followed by arguments to /proc/acpi/call.
This module is superseeded by projects like bbswitch. You may use it where bbswitch is not
appropriate, e.g. with Optimus-Chipsets and Nvidia-drivers.
It allows you to tamper with your system and should be used with caution.
%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=%{buildroot}
export INSTALL_MOD_DIR=%{kernel_module_package_moddir} %{name}
for flavor in %{flavors_to_build} ; do
make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
done
install -dm755 %{buildroot}%{_libexecdir}/modules-load.d/
echo "acpi_call" >> %{buildroot}%{_libexecdir}/modules-load.d/acpi_call.conf
%files
%defattr(-,root,root)
%doc source/README.md
%dir %{_libexecdir}/modules-load.d
%config %{_libexecdir}/modules-load.d/acpi_call.conf
%changelog