File acpica.spec of Package acpica

#
# spec file for package acpica
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           acpica
Url:            http://acpica.org
# How to fetch acpi-tools:
# git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
# cd linux-2.6/tools/power/acpi
# mkdir -p include/acpi
# cp ../../../include/acpi/* include/acpi
# tar -cvjf acpi-tools-3.15 `find *`
Version:        20140214
Release:        0
%define acpi_tools_dir acpi-tools-3.14
%define src_dir acpica-unix2-%{version}
%define dmp_ver 20110323
Summary:        This is a set of tools to display and debug your BIOS ACPI tables
License:        GPL-2.0
Group:          Development/Tools/Debuggers
Source:         %{src_dir}.tar.bz2
Patch1:         acpica-no-compiletime.patch
Patch2:         wmidump_add_she_bang.patch
Source1:        ec_access.c
Source2:        acpi_genl.tar.bz2
Source3:        acpi_validate
Source4:        wmidump.tar.bz2
Source5:        %{acpi_tools_dir}.tar.bz2
Source6:        generate_acpi-tools_tarball.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 ia64 x86_64
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  glibc-devel
Provides:       iasl

%description
The included tools share the same code as it is used in the ACPI
implementation of the kernel. The code of the acpica project is exactly
the same as the ACPI parser and interpreter code of the kernel and the
code gets synced regularly from the acpica project into the kernel.
E.g. if you identify bugs in the kernel's ACPI implementation it might
be easier to debug them in userspace if possible. If the bug is part of
the acpica code, it has to be submitted to the acpica project to get
merged into the mainline kernel sources.

iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine
Language). This AML is suitable for inclusion as a DSDT in system
firmware. It also can disassemble AML, for debugging purposes.



Authors:
--------
    "Moore, Robert" <robert.moore@intel.com>
    and other Intel people

%prep
%setup -n %{src_dir} -a 2 -a 4 -a 5
%patch1 -p1
%patch2 -p1

%build
cc %{SOURCE1} %{optflags} -o ec_access
make -C acpi_genl CFLAGS="%{optflags}"
make -C wmidump CFLAGS="%{optflags}"
make OPT_CFLAGS="%{optflags}" HOST="_LINUX"
make -C %{acpi_tools_dir} CFLAGS="-DDEFINE_ALTERNATE_TYPES -I include %{optflags}"

%install
install -Dm 755 %{SOURCE3} %{buildroot}/usr/bin/acpi_validate
install -Dm 755 ec_access %{buildroot}/usr/sbin/ec_access

install -Dm 755 wmidump/wmidump %{buildroot}/usr/bin/wmidump
install -Dm 755 wmidump/wmixtract.py %{buildroot}/usr/bin/wmixtract
install -Dm 644 wmidump/README %{buildroot}/%{_docdir}/%{name}/README_wmidump

install -Dm 755 acpi_genl/acpi_genl %{buildroot}/usr/sbin/acpi_genl
install -Dm 644 acpi_genl/README %{buildroot}/%{_docdir}/%{name}/README_acpi_genl

install -Dm 644 changes.txt %{buildroot}/%{_docdir}/%{name}/changes.txt
make install DESTDIR="%{buildroot}"
# Latest acpidump is coming from kernel and not from acpica sources now.
rm -rf "%{buildroot}"/usr/bin/acpidump
make -C %{acpi_tools_dir} install DESTDIR="%{buildroot}" mandir=/usr/share/man

%files
%defattr(-,root,root)
/usr/bin/iasl
/usr/bin/acpiexec
/usr/bin/acpixtract
/usr/bin/acpisrc
/usr/bin/wmidump
/usr/bin/wmixtract
/usr/sbin/acpidump
/usr/sbin/acpi_genl
/usr/sbin/ec_access
/usr/bin/acpibin
/usr/bin/acpihelp
/usr/bin/acpinames
/usr/bin/acpi_validate
/usr/bin/acpiexamples
%{_mandir}/man8/acpidump.8*

%doc %{_docdir}/%{name}

%changelog
openSUSE Build Service is sponsored by