File acpi_call.spec of Package acpi_call
#
# spec file for package acpi_call
#
# Copyright (c) 2025 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: master
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
Source0: %{name}-%{version}.tar.xz
Source1: preamble
Source2: %{name}-rpmlintrc
BuildRequires: %{kernel_module_package_buildreqs}
BuildRequires: pesign-obs-integration
Requires: %{name}-kmp
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# This directive instructs the build service to temporarily save the project's
# certificate as %%_sourcedir/_projectcert.crt. See:
# https://github.com/openSUSE/pesign-obs-integration
# https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual/index.html#sec-signing-module-object
# https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual/index.html#sec-appendix-a1
#
# needssslcertforbuild
#
# Having included the above directive, the below line will
# cause the "ueficert" package to get built.
%kernel_module_package -p %_sourcedir/preamble
%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.
%package KMP
Summary: acpi_call kernel module
Group: System/Kernel
%description KMP
The Linux Kernel Module Package for acpi_call.
%prep
%setup -q -D
cd %{builddir}/%{name}-%{version}
cd ../%{name}-%{version}
mkdir source
mkdir obj
cp -r %{_sourcedir}/%{name}-%{version}/. source/
%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}%{_modulesloaddir}
echo "acpi_call" >> %{buildroot}%{_modulesloaddir}/acpi_call.conf
# These env vars are used by the `pesign-obs-integration` package when signing
# the modules for Secure Boot.
export BRP_PESIGN_FILES='*.ko'
export BRP_PESIGN_COMPRESS_MODULE="xz"
%files
%defattr(-,root,root)
%doc source/README.md
%{_modulesloaddir}/acpi_call.conf
%changelog