afae4e7
Name:           acpica-tools
d1429af
Version:        20141107
5ebb5b7
Release:        1%{?dist}
afae4e7
Summary:        ACPICA tools for the development and debug of ACPI tables
afae4e7
afae4e7
Group:          Development/Languages
afae4e7
License:        GPLv2
afae4e7
URL:            https://www.acpica.org/
afae4e7
afae4e7
Source0:        https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.tar.gz
afae4e7
Source1:        https://acpica.org/sites/acpica/files/acpitests-unix-%{version}.tar.gz
afae4e7
Source2:        README.Fedora
afae4e7
Source3:        iasl.1
afae4e7
Source4:        acpibin.1
afae4e7
Source5:        acpidump.1
afae4e7
Source6:        acpiexec.1
afae4e7
Source7:        acpihelp.1
afae4e7
Source8:        acpinames.1
afae4e7
Source9:        acpisrc.1
afae4e7
Source10:       acpixtract.1
afae4e7
Source11:       badcode.asl.result
afae4e7
Source12:       grammar.asl.result
afae4e7
Source13:       run-misc-tests.sh
afae4e7
Source14:       COPYING
afae4e7
afae4e7
Patch0:         debian-big_endian.patch
afae4e7
Patch1:         debian-unaligned.patch
afae4e7
Patch2:         name-miscompare.patch
afae4e7
Patch3:         aapits-linux.patch
ff28045
Patch4:         asllookup-miscompare.patch
4542dd1
Patch5:         aapits-makefile.patch
09074c9
Patch6:		re-enable-big-endian.patch
d1429af
Patch7:		OPT_LDFLAGS.patch
afae4e7
afae4e7
BuildRequires:  bison patchutils flex
afae4e7
afae4e7
# The previous iasl package contained only a very small subset of these tools
afae4e7
# and it produced only the iasl package listed below; further, the pmtools
afae4e7
# package -- which provides acpidump -- also provides a /usr/sbin/acpixtract
afae4e7
# that we don't really want to collide with
afae4e7
Provides:       acpixtract >= 20120913-7
afae4e7
Provides:       iasl = %{version}-%{release}
3905933
Obsoletes:      iasl < 20120913-8
afae4e7
afae4e7
# The pmtools package provides an obsolete and deprecated version of the
afae4e7
# acpidump command from lesswatts.org which has now been taken off-line.
afae4e7
# ACPICA, however, is providing a new version and we again do not want to
afae4e7
# conflict with the command name.
afae4e7
Provides:       acpidump >= 20100513-5
afae4e7
Provides:       pmtools = %{version}-%{release}
10cdd19
Obsoletes:      pmtools < 20100513-6
afae4e7
afae4e7
%description
afae4e7
The ACPI Component Architecture (ACPICA) project provides an OS-independent
afae4e7
reference implementation of the Advanced Configuration and Power Interface
afae4e7
Specification (ACPI).  ACPICA code contains those portions of ACPI meant to
afae4e7
be directly integrated into the host OS as a kernel-resident subsystem, and
afae4e7
a small set of tools to assist in developing and debugging ACPI tables.
afae4e7
afae4e7
This package contains only the user-space tools needed for ACPI table
afae4e7
development, not the kernel implementation of ACPI.  The following commands
afae4e7
are installed:
afae4e7
   -- iasl: compiles ASL (ACPI Source Language) into AML (ACPI Machine
afae4e7
      Language), suitable for inclusion as a DSDT in system firmware.
afae4e7
      It also can disassemble AML, for debugging purposes.
afae4e7
   -- acpibin: performs basic operations on binary AML files (e.g.,
afae4e7
      comparison, data extraction)
afae4e7
   -- acpidump: write out the current contents of ACPI tables
afae4e7
   -- acpiexec: simulate AML execution in order to debug method definitions
afae4e7
   -- acpihelp: display help messages describing ASL keywords and op-codes
afae4e7
   -- acpinames: display complete ACPI name space from input AML
afae4e7
   -- acpisrc: manipulate the ACPICA source tree and format source files
afae4e7
      for specific environments
afae4e7
   -- acpixtract: extract binary ACPI tables from acpidump output (see
afae4e7
      also the pmtools package)
afae4e7
afae4e7
This version of the tools is being released under GPLv2 license.
afae4e7
afae4e7
%prep
afae4e7
%setup -q -n acpica-unix2-%{version}
afae4e7
%setup -q -T -D -a 1 -n acpica-unix2-%{version}
afae4e7
gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f -
afae4e7
afae4e7
%patch0 -p1 -b .debian-big_endian
afae4e7
%patch1 -p1 -b .debian-unaligned
afae4e7
%patch2 -p1 -b .name-miscompare
afae4e7
%patch3 -p1 -b .aapits-linux
ff28045
%patch4 -p1 -b .asllookup-miscompare
4542dd1
%patch5 -p1 -b .aapits-makefile
09074c9
%patch6 -p1 -b .re-enable-big-endian
d1429af
%patch7 -p1 -b .OPT_LDFLAGS
afae4e7
afae4e7
cp -p %{SOURCE2} README.Fedora
afae4e7
cp -p %{SOURCE3} iasl.1
afae4e7
cp -p %{SOURCE4} acpibin.1
afae4e7
cp -p %{SOURCE5} acpidump.1
afae4e7
cp -p %{SOURCE6} acpiexec.1
afae4e7
cp -p %{SOURCE7} acpihelp.1
afae4e7
cp -p %{SOURCE8} acpinames.1
afae4e7
cp -p %{SOURCE9} acpisrc.1
afae4e7
cp -p %{SOURCE10} acpixtract.1
afae4e7
cp -p %{SOURCE11} badcode.asl.result
afae4e7
cp -p %{SOURCE12} grammar.asl.result
afae4e7
cp -p %{SOURCE13} tests/run-misc-tests.sh
afae4e7
chmod a+x tests/run-misc-tests.sh
afae4e7
cp -p %{SOURCE14} COPYING
afae4e7
afae4e7
# spurious executable permissions on text files in upstream
afae4e7
chmod a-x changes.txt
afae4e7
chmod a-x source/compiler/new_table.txt
afae4e7
afae4e7
afae4e7
%build
af93ebf
make OPT_CFLAGS="%{optflags}" OPT_LDFLAGS="%{__global_ldflags}"
afae4e7
afae4e7
afae4e7
%install
afae4e7
# Install the binaries
afae4e7
mkdir -p %{buildroot}%{_bindir}
afae4e7
install -pD generate/unix/bin*/* %{buildroot}%{_bindir}/
afae4e7
mv %{buildroot}%{_bindir}/acpidump %{buildroot}%{_bindir}/acpidump-acpica
afae4e7
mv %{buildroot}%{_bindir}/acpixtract %{buildroot}%{_bindir}/acpixtract-acpica
afae4e7
afae4e7
# Install the man pages
afae4e7
mkdir -p %{buildroot}%{_mandir}/man1
afae4e7
install -pDm 0644 -p -D *.1 %{buildroot}%{_mandir}/man1/
afae4e7
mv %{buildroot}%{_mandir}/man1/acpixtract.1 \
afae4e7
   %{buildroot}%{_mandir}/man1/acpixtract-acpica.1
afae4e7
mv %{buildroot}%{_mandir}/man1/acpidump.1 \
afae4e7
   %{buildroot}%{_mandir}/man1/acpidump-acpica.1
afae4e7
afae4e7
%check
afae4e7
cd tests
afae4e7
afae4e7
# ASL tests
afae4e7
./aslts.sh                         # relies on non-zero exit
afae4e7
[ $? -eq 0 ] || exit 1
afae4e7
afae4e7
# API tests
afae4e7
cd aapits
afae4e7
make
afae4e7
cd asl
afae4e7
ASL=%{buildroot}%{_bindir}/iasl make
afae4e7
cd ../bin
afae4e7
./aapitsrun
afae4e7
[ $? -eq 0 ] || exit 1
afae4e7
cd ../..
afae4e7
afae4e7
# misc tests
afae4e7
./run-misc-tests.sh %{buildroot}%{_bindir} %{version}
afae4e7
afae4e7
# Template tests
afae4e7
cd templates
afae4e7
make
afae4e7
if [ -f diff.log ]
afae4e7
then
afae4e7
    if [ -s diff.log ]
afae4e7
    then
afae4e7
        exit 1                  # implies errors occurred
afae4e7
    fi
afae4e7
fi
afae4e7
cd ..
afae4e7
afae4e7
afae4e7
%post
afae4e7
alternatives --install %{_bindir}/acpixtract acpixtract \
afae4e7
                       %{_bindir}/acpixtract-acpica 120 \
afae4e7
               --slave %{_mandir}/man1/acpixtract.1.gz acpixtract.1.gz \
4542dd1
                       %{_mandir}/man1/acpixtract-acpica.1.gz
afae4e7
afae4e7
alternatives --install %{_bindir}/acpidump acpidump \
afae4e7
                       %{_bindir}/acpidump-acpica 120 \
afae4e7
               --slave %{_mandir}/man1/acpidump.1.gz acpidump.1.gz \
4542dd1
                       %{_mandir}/man1/acpidump-acpica.1.gz
afae4e7
afae4e7
afae4e7
%postun
afae4e7
if [ ! -e %{_bindir}/acpixtract-acpica ]
afae4e7
then
afae4e7
    alternatives --remove acpixtract %{_bindir}/acpixtract-acpica
afae4e7
fi
afae4e7
if [ ! -e %{_bindir}/acpidump-acpica ]
afae4e7
then
afae4e7
    alternatives --remove acpidump %{_bindir}/acpidump-acpica
afae4e7
fi
afae4e7
afae4e7
afae4e7
%files
afae4e7
%doc changes.txt source/compiler/new_table.txt
afae4e7
%doc README.Fedora COPYING
afae4e7
%{_bindir}/*
afae4e7
%{_mandir}/*/*
afae4e7
afae4e7
afae4e7
%changelog
d1429af
* Mon Nov 17 2014 Al Stone <ahs3@redhat.com> - 20141107-1
d1429af
- Update to latest upstream.  Closes BZ#1147131.
d1429af
- Refresh patches
d1429af
- Patch to ensure ASLTS always reports when an error occurs, instead
d1429af
  of glossing over it has been incorporated upstream, so remove patch.
d1429af
c328591
* Wed Oct 1 2014 Al Stone <ahs3@redhat.com> - 20140926-1
dd88205
- Update to latest upstream.  Closes BZ#1147131.
c328591
- Refresh patches
1c109db
- Add patch to ensure ASLTS always reports when an error occurs, instead
1c109db
  of glossing over it.
af93ebf
- Add use of %__global_ldflags.  Closes BZ#1126134.
dd88205
5ebb5b7
* Fri Aug 29 2014 Al Stone <ahs3@redhat.com> - 20140828-1
5ebb5b7
- Update to latest upstream.  Closes BZ#1135352.
5ebb5b7
- Refresh patches.
5ebb5b7
04e00d8
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20140724-2
04e00d8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
04e00d8
4978c45
* Mon Jul 28 2014 Al Stone <ahs3@redhat.com> - 20140724-1
4978c45
- Update to latest upstream.  Closes BZ#1114275.
4978c45
- This update adds support for the 5.1 version of the ACPI specification
f1b2c55
- Refresh patches so everything applies properly.
4978c45
54d979f
* Fri Jun 6 2014 Dan HorĂ¡k <dan[at]danny.cz> - 20140424-3
54d979f
- refresh the big endian patch so it applies correctly, fixes build on big endians
54d979f
09074c9
* Thu May 22 2014 Al Stone <ahs3@redhat.com> - 20140424-2
09074c9
- Add ppc64le as a 64-bit arch in run-misc-tests.sh.  Closes BZ#1098614.
09074c9
- Re-enable big-endian support in iasl.
09074c9
acd0575
* Wed May 7 2014 Al Stone <ahs3@redhat.com> - 20140424-1
acd0575
- Update to latest upstream.  Closes BZ#1091189.
acd0575
4542dd1
* Fri Apr 4 2014 Al Stone <ahs3@redhat.com> - 20140325-1
4542dd1
- Update to latest upstream.  Closes BZ#1080791.
4542dd1
- Incorporated patch to fix broken symlinks.  Closes BZ#1074256.
4542dd1
- Add patch to fix missing .o files in aapits tests.
4542dd1
ff28045
* Wed Feb 26 2014 Al Stone <ahs3@redhat.com> - 20140214-1
ff28045
- Update to latest upstream.  Closes BZ#1053396.
ff28045
- Remove temporary patch so that AAPITS will build and run.
ff28045
- Add patch to print asllookup.c warning properly on big endian;
ff28045
  Closes BZ#1069178.
ff28045
db6b4f2
* Tue Jan 21 2014 Al Stone <ahs3@redhat.com> - 20140114-1
db6b4f2
- Update to latest upstream.  Closes BZ#1053396.
db6b4f2
- Remove temporary patch to add Makefile missing from upstream tarball.
db6b4f2
- Add temporary patch so that AAPITS will build and run.
db6b4f2
d3f3d37
* Tue Jan 7 2014 Al Stone <ahs3@redhat.com> - 20131218-1
d3f3d37
- Update to latest upstream.  Closes BZ#1044951.
d3f3d37
- Add temporary patch to add Makefile missing from upstream tarball.
d3f3d37
685b568
* Mon Nov 25 2013 Al Stone <ahs3@redhat.com> - 20131115-1
685b568
- Update to latest upstream.  Closes BZ#1031255.
a03e600
- Add a little code to workaround build problems that can occur (the tests
a03e600
  will fail) when a build starts before midnight, but ends after midnight
a03e600
- Remove patch to include Makefile.config that was missing from tarball.
685b568
45a0b48
* Wed Oct 09 2013 Al Stone <ahs3@redhat.com> - 20130927-1
45a0b48
- Update to latest upstream.  Closes BZ#1013090.
45a0b48
- Add temporary patch to include Makefile.config being missing from tarball.
45a0b48
3905933
* Fri Sep 13 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 20130823-5
3905933
- correct iasl obs_ver
3905933
8b68bca
* Tue Sep 10 2013 Dean Nelson <dnelson@redhat.com> - 20130823-4
4c70b59
- Fix run-misc-tests.sh script to properly set the number of BITS to 64
4c70b59
  when run on a s390x system.
4c70b59
10cdd19
* Tue Sep 10 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 20130823-3
10cdd19
- correct pmtools obs_ver
10cdd19
afae4e7
* Tue Aug 27 2013 Al Stone <ahs3@redhat.com> - 20130823-2
afae4e7
- Add in a copy of the GPLv2 text in order to comply with the requirement
afae4e7
  to always redistribute the terms of the license.
afae4e7
afae4e7
* Mon Aug 26 2013 Al Stone <ahs3@redhat.com> - 20130823-1
afae4e7
- Update to latest upstream source.
afae4e7
afae4e7
* Tue Aug 20 2013 Al Stone <ahs3@redhat.com> - 20130725-2
afae4e7
- Fix several rpmlint items (listed below)
afae4e7
- Add versions to explicit provides for acpixtract, acpidump
afae4e7
- Not all setup steps used -q
afae4e7
- Setup executable test script (run-misc-tests.sh) differently
afae4e7
- Removed unneeded commented out line with macros in it
afae4e7
- Removed mixed use of spaces and tabs (all spaces now)
afae4e7
- Corrected source URLs (upstream moved)
afae4e7
afae4e7
* Sun Aug 18 2013 Al Stone <ahs3@redhat.com> - 20130725-1
afae4e7
- Update to latest upstream source.
afae4e7
afae4e7
* Wed Jul 24 2013 Al Stone <ahs3@redhat.com> - 20130626-1
afae4e7
- Update to latest upstream source.
afae4e7
- Move acpidump to acpidump-acpica so it be an alternative properly
afae4e7
- Add basic man page for acpidump
afae4e7
- Enable use of AAPITS tests during the check step
afae4e7
afae4e7
* Sun Jun 02 2013 Al Stone <ahs3@redhat.com> - 20130517-2
afae4e7
- Correct an oversight: we provide an acpidump in conflict with the
afae4e7
  version in pmtools (which appears to be dead upstream) but had not
afae4e7
  made it an alternative before
afae4e7
afae4e7
* Tue May 28 2013 Al Stone <ahs3@redhat.com> - 20130517-1
afae4e7
- Update to latest upstream source.
afae4e7
- Remove acpica-tools-config.patch -- now in upstream
afae4e7
- Remove iasl-signed-char.patch -- now in upstream
afae4e7
- Updated debian-big_endian.patch
afae4e7
- Updated debian-unaligned.patch
afae4e7
afae4e7
* Mon May 13 2013 Al Stone <ahs3@redhat.com> - 20130328-1
afae4e7
- Update to latest upstream source.
afae4e7
afae4e7
* Wed Mar 20 2013 Al Stone <ahs3@redhat.com> - 20130214-2
afae4e7
- Incorporate use of optflags macro in the build.
afae4e7
- Remove extraneous rm -rf of buildroot.
afae4e7
- Remove extraneous use of defattr in the files section.
afae4e7
- Incorporate use of parallel make.
afae4e7
- Remove extraneous use of the clean section.
afae4e7
- Use simpler globbing in the files section.
afae4e7
- Use simpler globbing in the install section.
afae4e7
- Remove obsolete git notes from README.Fedora.
afae4e7
- Remove ExcludeArch restrictions.
afae4e7
afae4e7
* Mon Feb 18 2013 Al Stone <ahs3@redhat.com> - 20130214-1
afae4e7
- New upstream.
afae4e7
- Remove most of the config file patch; still need to remove -m{32,64}.
afae4e7
- Clarify the licensing; this source is dual-licensed and is being released
afae4e7
  under the GPLv2 as allowed by the original Intel license.
afae4e7
- Redo the misc tests so they compare results properly.
afae4e7
afae4e7
* Wed Feb 06 2013 Al Stone <ahs3@redhat.com> - 20130117-6
afae4e7
- Added a zero-fill to a date used in comparing testing results so that the
afae4e7
  comparison would be correct on days numbered < 10.
afae4e7
afae4e7
* Thu Jan 31 2013 Al Stone <ahs3@redhat.com> - 20130117-5
afae4e7
- Simplify versioning scheme and revert to the original scheme in use by
afae4e7
  iasl, which is use the latest official tarball date (2013017) as the
afae4e7
  version and 1%{?dist} as the release, to be incremented for packaging
afae4e7
  and bug fixes as needed.
afae4e7
afae4e7
* Wed Jan 30 2013 Al Stone <ahs3@redhat.com> - 20130117-4
afae4e7
- Do a little reset: go back to using just the original upstream tarball
afae4e7
  instead of the latest git; the snapshot approach was more complicated
afae4e7
  than needed.
afae4e7
- Upstream tarballs split commands from test suites, so had to add the
afae4e7
  test suite back in as another Source: file.
afae4e7
- Change versioning scheme to include the APCI specification level (5.0),
afae4e7
  the latest official tarball date (2013017) and a revision level  (the
afae4e7
  .1 at the end) for packaging and bug fixes as needed.
afae4e7
- Changed the License field to reflect the source tarball change; the release
afae4e7
  tarball is dual-licensed, Intel ACPI or GPLv2.
afae4e7
- Updated patches to apply cleanly as needed.
afae4e7
- Corrected Obsoletes and Provides version numbers.
afae4e7
afae4e7
* Mon Jan 28 2013 Al Stone <ahs3@redhat.com> - 20130117-3
afae4e7
- Reconcile Fedora and Debian patches to be as alike as possible
afae4e7
afae4e7
* Mon Jan 28 2013 Al Stone <ahs3@redhat.com> - 20130117-2
afae4e7
- Verify ExcludeArch restrictions -- the architectures excluded can have
afae4e7
  no use for these tools.  Hardware support for ACPI is simply not
afae4e7
  implemented for them.
afae4e7
- Corrected versioning to note this source came from a git pull.
afae4e7
- Add License file as upstream has not yet provided one (and has not for
afae4e7
  many years).
afae4e7
- Insert properly versioned Provides and Obsoletes for iasl.
afae4e7
- Corrected files to use man.1* (vs man.1.gz) to allow flexibility in the
afae4e7
  compression being used.
afae4e7
afae4e7
* Wed Jan 23 2013 Al Stone <ahs3@redhat.com> - 20130117-1
afae4e7
- Clone from the current iasl package, with the intent of replacing it
afae4e7
- Update source to latest upstream
afae4e7
- NB: ACPICA documentation would normally be included in a source tarball.
afae4e7
  But, since it is not clearly redistributable, it is not included in the
afae4e7
  source RPM for this package.
afae4e7
- Build all ACPICA tools, not just iasl (and hence the package replacement)
afae4e7
- Add in brief man pages
afae4e7
- Set up acpixtract from this package as an alternative to the same command
afae4e7
  in the pmtools package
afae4e7
- Run the check step once built
afae4e7