Blame acpica.spec

Bernhard M. Wiedemann 8fb0d1
#
Bernhard M. Wiedemann 8fb0d1
# spec file for package acpica
Bernhard M. Wiedemann 8fb0d1
#
3f1204
# Copyright (c) 2022 SUSE LLC
Bernhard M. Wiedemann 8fb0d1
#
Bernhard M. Wiedemann 8fb0d1
# All modifications and additions to the file contributed by third parties
Bernhard M. Wiedemann 8fb0d1
# remain the property of their copyright owners, unless otherwise agreed
Bernhard M. Wiedemann 8fb0d1
# upon. The license for this file, and modifications and additions to the
Bernhard M. Wiedemann 8fb0d1
# file, is the same license as for the pristine package itself (unless the
Bernhard M. Wiedemann 8fb0d1
# license for the pristine package is not an Open Source License, in which
Bernhard M. Wiedemann 8fb0d1
# case the license is the MIT License). An "Open Source License" is a
Bernhard M. Wiedemann 8fb0d1
# license that conforms to the Open Source Definition (Version 1.9)
Bernhard M. Wiedemann 8fb0d1
# published by the Open Source Initiative.
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Bernhard M. Wiedemann 8fb0d1
#
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%define src_dir acpica-unix-%{version}
Bernhard M. Wiedemann 8fb0d1
%define kver %(rpm -q --qf '%%{VERSION}' kernel-source)
Bernhard M. Wiedemann 8fb0d1
%define dmp_ver %{kver}
Bernhard M. Wiedemann 8fb0d1
Name:           acpica
41f8a7
Version:        20221020
Bernhard M. Wiedemann 8fb0d1
Release:        0
Bernhard M. Wiedemann 8fb0d1
Summary:        A set of tools to display and debug BIOS ACPI tables
Bernhard M. Wiedemann 8fb0d1
License:        GPL-2.0-only
Bernhard M. Wiedemann 3c3762
URL:            https://acpica.org
41f8a7
Source:         https://acpica.org/sites/acpica/files/%{src_dir}.tar_0.gz
Bernhard M. Wiedemann 8fb0d1
Source1:        ec_access.c
Bernhard M. Wiedemann 8fb0d1
Source2:        acpi_genl.tar.bz2
Bernhard M. Wiedemann 8fb0d1
Source3:        acpi_validate
12c782
# https://xf.iksaif.net/dev/wmidump.html
12c782
Source4:        wmidump-20211011.tar.xz
Bernhard M. Wiedemann 8fb0d1
Patch1:         acpica-no-compiletime.patch
Bernhard M. Wiedemann 8fb0d1
Patch2:         wmidump_add_she_bang.patch
Bernhard M. Wiedemann 8fb0d1
Patch3:         do_not_use_build_date_and_time.patch
Bernhard M. Wiedemann 8fb0d1
BuildRequires:  bison
Bernhard M. Wiedemann 8fb0d1
BuildRequires:  flex
Bernhard M. Wiedemann 8fb0d1
BuildRequires:  glibc-devel
Bernhard M. Wiedemann 8fb0d1
BuildRequires:  kernel-source >= 2.6.31
Bernhard M. Wiedemann 8fb0d1
BuildRequires:  patch
Bernhard M. Wiedemann 8fb0d1
Provides:       iasl
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%description
Bernhard M. Wiedemann 8fb0d1
The included tools share the same code as it is used in the ACPI
Bernhard M. Wiedemann 8fb0d1
implementation of the kernel. The code of the acpica project is exactly
Bernhard M. Wiedemann 8fb0d1
the same as the ACPI parser and interpreter code of the kernel and the
Bernhard M. Wiedemann 8fb0d1
code gets synced regularly from the acpica project into the kernel.
Bernhard M. Wiedemann 8fb0d1
E.g. if you identify bugs in the kernel's ACPI implementation it might
Bernhard M. Wiedemann 8fb0d1
be easier to debug them in userspace if possible. If the bug is part of
Bernhard M. Wiedemann 8fb0d1
the acpica code, it has to be submitted to the acpica project to get
Bernhard M. Wiedemann 8fb0d1
merged into the mainline kernel sources.
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine
Bernhard M. Wiedemann 8fb0d1
Language). This AML is suitable for inclusion as a DSDT in system
Bernhard M. Wiedemann 8fb0d1
firmware. It also can disassemble AML, for debugging purposes.
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%prep
Bernhard M. Wiedemann 8fb0d1
%setup -q -n %{src_dir} -a 2 -a 4
38b146
%autopatch -p1
Bernhard M. Wiedemann 8fb0d1
mkdir acpidump-%{dmp_ver}
Bernhard M. Wiedemann 8fb0d1
cd acpidump-%{dmp_ver}
Bernhard M. Wiedemann 8fb0d1
# acpitools (acpidump) from kernel sources:
Bernhard M. Wiedemann 8fb0d1
# copy necessary files from kernel-source since we need to modify them
Bernhard M. Wiedemann 8fb0d1
(cd %{_prefix}/src/linux ; tar -cf - COPYING CREDITS README tools include scripts Kbuild Makefile drivers/acpi lib) | tar -xf -
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%build
Bernhard M. Wiedemann e267a7
%global optflags %{optflags} -fcommon
Bernhard M. Wiedemann e267a7
export CFLAGS="%{optflags}"
Bernhard M. Wiedemann e267a7
export CXXFLAGS="%{optflags}"
Bernhard M. Wiedemann 8fb0d1
cc %{SOURCE1} %{optflags} -o ec_access
Bernhard M. Wiedemann 3c3762
%make_build -C acpi_genl CFLAGS="%{optflags}"
Bernhard M. Wiedemann 3c3762
%make_build -C wmidump CFLAGS="%{optflags}"
Bernhard M. Wiedemann 3c3762
%make_build OPT_CFLAGS="%{optflags} -fcommon"  HOST="_LINUX"
Bernhard M. Wiedemann 8fb0d1
cd acpidump-%{dmp_ver}/tools/power/acpi
Bernhard M. Wiedemann 8fb0d1
if [ -f tools/acpidump/Makefile ]; then # 4.3+
Bernhard M. Wiedemann 8fb0d1
	cd tools/acpidump/
Bernhard M. Wiedemann 8fb0d1
fi
Bernhard M. Wiedemann 3c3762
%make_build EXTRA_CFLAGS="%{optflags} -fno-strict-aliasing" prefix=%{_prefix} all
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%install
Bernhard M. Wiedemann 8fb0d1
install -Dm 755 %{SOURCE3} %{buildroot}%{_bindir}/acpi_validate
Bernhard M. Wiedemann 8fb0d1
install -Dm 755 ec_access %{buildroot}%{_sbindir}/ec_access
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
install -Dm 755 wmidump/wmidump %{buildroot}%{_bindir}/wmidump
Bernhard M. Wiedemann 8fb0d1
install -Dm 755 wmidump/wmixtract.py %{buildroot}%{_bindir}/wmixtract
12c782
install -Dm 644 wmidump/README.md %{buildroot}/%{_docdir}/%{name}/README_wmidump.md
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
install -Dm 755 acpi_genl/acpi_genl %{buildroot}%{_sbindir}/acpi_genl
Bernhard M. Wiedemann 8fb0d1
install -Dm 644 acpi_genl/README %{buildroot}/%{_docdir}/%{name}/README_acpi_genl
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%make_install
Bernhard M. Wiedemann 8fb0d1
# Latest acpidump is coming from kernel and not from acpica sources now.
Bernhard M. Wiedemann 8fb0d1
rm -rf %{buildroot}%{_bindir}/acpidump
Bernhard M. Wiedemann 8fb0d1
cd acpidump-%{dmp_ver}/tools/power/acpi
Bernhard M. Wiedemann 8fb0d1
if [ -f tools/acpidump/Makefile ]; then # 4.3+
Bernhard M. Wiedemann 8fb0d1
	cd tools/acpidump/
Bernhard M. Wiedemann 8fb0d1
fi
Bernhard M. Wiedemann 8fb0d1
export WERROR=0
Bernhard M. Wiedemann 8fb0d1
make V=1 EXTRA_CFLAGS="%{optflags}" mandir=%{_mandir} prefix=%{_prefix} DESTDIR=%{buildroot} install install-man
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%files
Bernhard M. Wiedemann 8fb0d1
%doc changes.txt
Bernhard M. Wiedemann 8fb0d1
%doc %{_docdir}/%{name}
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/iasl
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpiexec
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpixtract
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpisrc
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/wmidump
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/wmixtract
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpibin
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpihelp
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpi_validate
Bernhard M. Wiedemann 8fb0d1
%{_bindir}/acpiexamples
Bernhard M. Wiedemann 8fb0d1
%{_sbindir}/acpidump
Bernhard M. Wiedemann 8fb0d1
%{_sbindir}/acpi_genl
Bernhard M. Wiedemann 8fb0d1
%{_sbindir}/ec_access
Bernhard M. Wiedemann 8fb0d1
%{_mandir}/man8/acpidump.8%{?ext_man}
Bernhard M. Wiedemann 8fb0d1
Bernhard M. Wiedemann 8fb0d1
%changelog