Blob Blame History Raw
%define SCRIPT_VERSION 1.4.6
Summary: Advanced Power Management (APM) BIOS utilities for laptops.
Name: apmd
Version: 3.0final
Release: 18
Source: ftp://ftp.debian.org/debian/dists/unstable/main/source/admin/%{name}_%{version}-1.tar.gz
Source1: apmd-scripts-%{SCRIPT_VERSION}.tar.bz2
Patch: apmd-3.0-FHS.patch
Patch1: apmd-typo.patch
License: GPL
Group: System Environment/Daemons
Prereq: chkconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-root
ExclusiveArch: i386 i486 i586 i686

%description
APMD is a set of programs for controlling the Advanced Power 
Management daemon and utilities found in most modern laptop 
computers. APMD can watch your notebook's battery and warn 
users when the battery is low. APMD is also capable of shutting 
down the PCMCIA sockets before a suspend.

Install the apmd package if you need to control the APM system 
on your laptop.

%prep
%setup -q -n apmd
%patch -p1 -b .FHS
%patch1 -p1 -b .typo

%build
make CFLAGS="$RPM_OPT_FLAGS" LDFLAGS=-s

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/{bin,include,lib,sbin,share/man/man1,share/man/man8,X11R6/bin,X11R6/man/man1}
mkdir -p $RPM_BUILD_ROOT/etc
make PREFIX=$RPM_BUILD_ROOT/usr APMD_PROXY_DIR=$RPM_BUILD_ROOT/etc install
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
cd $RPM_BUILD_ROOT && tar xIf %{SOURCE1}

# hack
rm -f $RPM_BUILD_ROOT/usr/bin/xapm $RPM_BUILD_ROOT%{_mandir}/man1/xapm.1x

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add apmd

%preun
if [ $1 = 0 ]; then
    service apmd stop > /dev/null 2>&1
    /sbin/chkconfig --del apmd
fi

%postun
if [ "$1" -ge "1" ]; then
    service apmd condrestart > /dev/null 2>&1
fi

%triggerpostun -- apmd <= 3.0final-6
/sbin/chkconfig --add apmd

%files
%defattr(-,root,root)
%doc ANNOUNCE ChangeLog README README.transfer LSM
%{_mandir}/man1/*
%{_mandir}/man8/*
/usr/bin/*
/usr/sbin/*
/usr/include/*
/usr/lib/*
%config /etc/rc.d/init.d/apmd
%config /etc/sysconfig/apmd
%config /etc/sysconfig/apm-scripts/*

%changelog
* Fri Aug 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix typo in suspend script, bug #16957
* Thu Aug 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix up "status" in init script, bug #16275

* Tue Aug  8 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- ignore "start" and "stop" events in apmscript instead of claiming
  they're unknown events (Bug #15598)

* Sat Aug 05 2000 Bill Nottingham <notting@redhat.com>
- condrestart fixes

* Thu Aug  3 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Handle "power" events in apmscript (Bug #15283)

* Tue Aug  1 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix typo in man page (Bug #14778)

* Mon Jul 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Use cardctl to suspend/resume pcmcia cards instead of restarting
  the entire subsystem (Bug #13836)

* Mon Jul 17 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Don't use obsolete parameters (Bug #13710)
- Add the possibility to lock X displays on suspend, based on patch from
  Hannu Martikka <Hannu.Martikka@nokia.com>
- some other fixes to the apmd scripts

* Sat Jul 15 2000 Bill Nottingham <notting@redhat.com>
- move initscript back

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Tue Jun 27 2000 Preston Brown <pbrown@redhat.com>
- don't prereq, just require initscripts

* Mon Jun 26 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix init script, move to /etc/init.d

* Sun Jun 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix resume for users of non-bash shells (Bug #11580)
- Support restoring sound with the commercial OSS drivers (Bug #11580)

* Mon Jun 19 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- FHSify

* Sat May 27 2000 Bernhard Rosenkränzer <bero@redhat.com>
- Some more changes to apm-scripts:
  - Fix up HDPARM_AT_RESUME
  - Add ANACRON_ON_BATTERY, and default to turning it off

* Mon May  8 2000 Bernhard Rosenkränzer <bero@redhat.com>
- Various fixes to the apm-scripts:
  - use modprobe instead of insmod for restoring sound
  - don't try to restore the X display if X isn't running
  - /usr/sbin/anacron, not /usr/bin/anacron
  - misc. cleanups

* Fri Feb  4 2000 Bernhard Rosenkränzer <bero@redhat.com>
- rebuild to compress man pages

* Mon Jan 17 2000 Bernhard Rosenkränzer <bero@redhat.com>
- Update to 3.0final

* Mon Jan 17 2000 Bernhard Rosenkränzer <bero@redhat.com>
- Fixes for UTC clocks (Bug #7939)

* Thu Jan  6 2000 Bernhard Rosenkränzer <bero@redhat.com>
- If anacron is installed, run it at resume time.

* Sun Nov 21 1999 Bernhard Rosenkränzer <bero@redhat.com>
- Fix up the broken harddisk fix (needs to be done earlier during suspend,
  also we need to manually wake the drive at resume.)

* Sun Nov 21 1999 Bernhard Rosenkränzer <bero@redhat.com>
- Updates to the apm-scripts and sysconfig/apmd:
  - Make hwclock --hctosys call optional (CLOCK_SYNC variable)
  - Add possibility to modify hdparm settings on suspend/resume.
    Some broken harddisks (Gericom 3xC) require this for suspend
    to disk to work.

* Wed Nov 10 1999 Bernhard Rosenkränzer <bero@redhat.com>
- Put in new apm scripts to handle PCMCIA suspend/resume, and give the
  possibility to refresh displays and reload sound modules for some
  broken chipsets
- permit builds on i486, i586 and i686 archs

* Mon Sep 20 1999 Michael K. Johnson <johnsonm@redhat.com>
- accept both "UTC=yes" and "UTC=true"

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- uh-oh, do I own this now?
- update to 3.0beta9

* Thu Jul  1 1999 Bill Nottingham <notting@redhat.com>
- start after, die before network fs...

* Sat Jun 12 1999 Jeff Johnson <jbj@redhat.com>
- add check for /proc/apm (not on SMP) (#3403)

* Mon May 31 1999 Jeff Johnson <jbj@redhat.com>
- shell script tweak (#3176).

* Fri May  7 1999 Bill Nottingham <notting@redhat.com>
- set -u flag for utc

* Sat Apr 17 1999 Matt Wilson <msw@redhat.com>
- prereqs chkconfig

* Fri Apr 16 1999 Cristian Gafton <gafton@redhat.com>
- exlusive arch i3786, as sparcs and alphas have no apm support...

* Wed Apr 14 1999 <ewt@redhat.com>
- removed X bits; gnome has a much better X interface for apm anyway

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 4)

* Fri Mar 19 1999 Preston Brown <pbrown@redhat.com>
- quoted APMD_OPTIONS variable in the init script

* Tue Mar 09 1999 Preston Brown <pbrown@redhat.com>
- whoops, making /etc/rc.d/init.d/apmd a directory was a bad idea. fixed.

* Mon Mar 08 1999 Preston Brown <pbrown@redhat.com>
- now owned by Avery Pennarun <apenwarr@debian.org>, upgraded to his latest.

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Fri Nov 06 1998 Preston Brown <pbrown@redhat.com>
- updated to latest patchlevel from web page.

* Wed Apr 22 1998 Michael K. Johnson <johnsonm@redhat.com>
- enhanced init script

* Thu Apr 1 1998 Erik Troan <ewt@redhat.com>
- moved init script into a separate source file
- added restart and status options to initscript
- made it use a build root
- don't start apm when the package is installed
- don't stop apm when the package is removed

* Mon Dec  8 1997 Jan "Yenya" Kasprzak <kas@fi.muni.cz>
- Compiled on RH5.0 against libc6.
- Renamed /etc/rc.d/init.d/apmd.init to /etc/rc.d/init.d/apmd
- Make /etc/rc.d/init.d/apmd to be chkconfig-compliant.

* Thu Oct  2 1997 Jan "Yenya" Kasprzak <kas@fi.muni.cz>
- Fixed buggy /etc/sysconfig/apmd file generation in the spec file.
- Added a patch for apm.c's option handling.
- Both fixes were submitted by Richard D. McRobers <rdm@csn.net>