File pm-utils.spec of Package pm-utils

#
# spec file for package pm-utils (Version 0.99.4.20071229)
#
# Copyright (c) 2008 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/
#

# norootforbuild


Name:           pm-utils
Url:            http://webcvs.freedesktop.org/pm-utils/
Version:        0.99.4.20071229
Release:        10
%define pm_utils_suse_version 20081107
Summary:        Tools to suspend and hibernate computers
License:        GPL v2 or later
Group:          System/Base
Source:         %{name}-%{version}.tar.bz2
Patch1:         pm-utils-0.99.4-on_ac_power-no-dbus-fallback.diff
Patch2:         pm-utils-0.99.4-QUIRK-variables-changed.diff
Patch3:         pm-utils-0.99.4-uswsusp-support.diff
Patch4:         pm-utils-0.99.4-configfile.diff
Patch5:         pm-utils-0.99.3-README-fix.diff
Patch6:         pm-utils-0.99.4-fix-broken-dbus-send.diff
Patch99:        pm-utils-0.99.4-suse.diff
Source1:        pm-utils-suse-%{pm_utils_suse_version}.tar.bz2
Source2:        README.upstream-hooks
Source3:        README.update
Source4:        rtcwake.config
Source5:        01ndiswrapper
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Prefix:         /usr
Requires:       hal

%description
pm-utils provide simple shell command line tools to suspend and
hibernate computers that can be used to run vendor or distro supplied
scripts on suspend and resume.



Authors:
--------
    Bill Nottingham <notting@redhat.com>
    Peter Jones <pjones@redhat.com>
    David Zeuthen <davidz@redhat.com>
    Richard Hughes <richard@hughsie.com>

%prep
%setup -b 1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p0
%patch6 -p1
%patch99 -p1

%build
export CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
make

%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p examples/hooks
for i in 01grub 20video 49bluetooth 55battery 60sysfont 65alsa 90clock 99video; do
    mv $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/$i examples/hooks
done
cp %{S:2} hooks
cp %{S:3} $RPM_BUILD_ROOT/etc/pm/
cp %{S:4} $RPM_BUILD_ROOT/etc/pm/config.d/
cp %{S:5} examples/hooks
cd ../pm-utils-suse
cp hooks/sleep.d/* $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/
cp hooks/power.d/* $RPM_BUILD_ROOT/usr/lib/pm-utils/power.d/
mkdir -p $RPM_BUILD_ROOT/var/log/
touch $RPM_BUILD_ROOT/var/log/pm-suspend.log

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-,root,root)
%dir /etc/pm
%dir /etc/pm/config.d
%dir /etc/pm/power.d
%dir /etc/pm/sleep.d
%doc /etc/pm/README.update
%config(noreplace) /etc/pm/config.d/rtcwake.config
/usr/sbin/*
/usr/bin/*
/usr/lib/pm-utils
%_mandir/man1/*
%doc README ChangeLog AUTHORS ../pm-utils-suse/doc/README.smart-suspend-to-RAM
%doc examples
%ghost %verify(not md5 size mtime) /var/log/pm-suspend.log

%changelog
* Thu Nov 27 2008 seife@suse.de
- remove 55battery hook - not needed since HAL 0.5.8
- add sub-second timestamps to the log file for hook profiling
* Wed Nov 12 2008 seife@suse.de
- log the start of suspend operations also to syslog, with a
  reference to the pm-suspend.log file
- added a reference to the documentation to the suspend log
- split off the QUIRK variable changes from
  pm-utils-0.99.4-uswsusp-support.diff into its own diff
* Fri Nov 07 2008 seife@suse.de
- improve suspend logging (log kernel version and commandline)
* Tue Oct 28 2008 anaumov@suse.de
- Added file 01ndiswrapper to documentation directory. It contains
  a possible workaound for resume problems with ndiswrapper
  (bnc#409110)
* Fri Oct 24 2008 hmacht@suse.de
- Minor fix to previous change
- Add basic logging functionality for pm-powersave
* Tue Oct 21 2008 hmacht@suse.de
- Kernel sysfs interfaces changed for the rf_kill switch and the
  wireless power saving methods (bnc#435393)
* Wed Oct 08 2008 seife@suse.de
- export some more variables for compatibility with that other
  pm-utils project: PM_UTILS_LIBDIR PM_UTILS_ETCDIR PM_FUNCTIONS
* Mon Oct 06 2008 seife@suse.de
- add support for "smart" detection of s2ram quirks
- add support for passing in quirks via command line from HAL
- add README.smart-suspend-to-RAM documentation
* Fri Sep 26 2008 seife@suse.de
- fix pm-action and functions for suspend-hybrid
* Wed Sep 24 2008 seife@suse.de
- update the tarball to the latest 0.99.4 upstream CVS which
  includes:
  - manpage fixes
  - fix for config file reading (patch dropped)
  - removal of dangerous laptop-tools hook
  - fixes for hooks running twice in some circumstances
- add support for hybrid suspend (write image to disk, then s2ram,
  FATE#6368)
- workaround broken dbus-send (bnc#427829)
* Fri Sep 12 2008 seife@suse.de
- Add a config file and hook for calling out to rtcwake, letting
  the user wake the computer up after N seconds of sleep or
  hibernation. The hook also respects the NUM_SECONDS_TO_SLEEP
  environment variable that HAL, for example, might set.
  [Fate#302448]
* Thu Jun 05 2008 seife@suse.de
- fix various small bugs in the power.d hooks for sound and iwl
  (bnc #394318)
* Mon May 26 2008 seife@suse.de
- fix an error message from sata-pm if no sata disks are present
* Fri May 09 2008 seife@suse.de
- remove power.d/laptop-tools hook, is now handled much better by
  laptop-mode-tools package
* Sat May 03 2008 hmacht@suse.de
- add hook for enabling audio power management and default to a
  timeout of 10 seconds
- add hook for enabling sata link power management (ALPM), but
  only for the root partition because of hotplug issues
* Mon Apr 28 2008 hmacht@suse.de
- add script 'iwl-pm.sh' to power.d/ for enabling iwl* power
  management
* Wed Nov 28 2007 lrupp@suse.de
- touch %%ghost file in %%install and add %%verify(not md5 size mtime)
- bzip the source
* Tue Nov 27 2007 seife@suse.de
- add the logfile to the filelist (novell bug 280475)
* Mon Sep 24 2007 seife@suse.de
- add README.update in /etc/pm and fix the README in the documen-
  tation to no longer mention /etc/pm/config but the correct paths
  (novell bug 327828).
* Thu Aug 16 2007 hmacht@suse.de
- remove '-s' option from openvt (00clear hook) to avoid flickering
  before suspend to disk
* Wed Jul 25 2007 hmacht@suse.de
- do not switch to console and back in pm-utils. Suspend tools are
  doing this in any case and splashy looks nicer this way
* Tue Jul 24 2007 seife@suse.de
- update to current CVS:
  - our export-variables patch included
  - minor build system tweaks
- fix reading of multiple configuration files
- removed docker hook, is now in dockutils
* Wed Apr 04 2007 seife@suse.de
- use long options for s2disk/s2both, short options will be depre-
  cated
- fix suspend to disk for HIBERNATE_METHOD=userspace
* Mon Mar 26 2007 seife@suse.de
- update to current CVS (version 0.99.3)
  - fix source_configs so it doesn't throw an error when the config
  dir is empty.
- rework userspace-suspend support
- fix exporting of variables
* Tue Mar 20 2007 seife@suse.de
- update to current CVS
  - module unloading and config handling fix integrated upstream
- pm-utils-suse: be more careful selecting the kernel for resume
  (bug 256105)
* Fri Mar 16 2007 seife@suse.de
- fix module unloading, pm-utils-0.99.2-fix-modunload.diff
* Fri Mar 16 2007 seife@suse.de
- update to current CVS
  - pm-utils-0.99.2-fix-stopservice.diff integrated upstream
- fix the handling of config files in /etc/pm/config.d/ (they were
  simply ignored before)
* Wed Mar 14 2007 seife@suse.de
- update to version 0.99.2+ (CVS as of today)
  - move the executables from /etc/pm to /usr/lib/pm-utils
  - config file from /etc/pm/config to /usr/lib/pm-utils/defaults
  - many of our local fixes applied upstream
  - add pm-suspend-hybrid (currently a no-op, will do s2both)
  - add pm-is-supported that will show HAL what suspend modes are
  available
  - use bash for scripts, not sh
  - fix module load/unload problems with module names that have
  "-" and "_".
* Wed Feb 28 2007 seife@suse.de
- fix cpufreq problem on multicore CPUs after resume (bug 227854)
* Tue Feb 20 2007 seife@suse.de
- update to current CVS
  - add pm-reset-swap to reset the swap signature after failed
  suspend to disk
  - some of our fixed incorporated upstream, patches dropped
- no longer unload the button module, kernel is fixed
* Sun Feb 18 2007 seife@suse.de
- support suspend to swap on LVM/EVMS (or generally if the resume
  parameter points to a symlink).
* Wed Dec 20 2006 seife@suse.de
- fix resume problems if the "Failsafe" kernel is listed before
  the "good" kernel in /boot/grub/menu.lst (bug 223722)
- package the disabled hooks in the documentation directory
- disable the 49blutetooth hook
* Tue Dec 05 2006 seife@suse.de
- fix 30s2disk-check hook, so that suspend with the kernel method
  works again (fixes bug 226115)
* Thu Nov 30 2006 seife@suse.de
- fix on_ac_power on desktops with battery powered mice
  (bug 221999)
- make running the hooks slightly more verbose
* Wed Nov 22 2006 seife@suse.de
- fix dualcore cpufreq problem after suspend (bug 223164)
- mark the configfile as "noreplace"
- print "resuming..." during resume
* Mon Nov 20 2006 seife@suse.de
- sync with current CVS, some of our patches went upstream
- print "Preparing suspend..." so the user has some feedback
* Thu Nov 16 2006 seife@suse.de
- comment the available variables in the configuration file
* Wed Nov 08 2006 seife@suse.de
- update to current CVS, some of our fixes incorporated upstream
- increase the logging output of the pm-utils-suse hooks
* Mon Nov 06 2006 hmacht@suse.de
- add 23dock hook to undock before suspend and redock after resume
* Mon Oct 30 2006 seife@suse.de
- update to current CVS, some of our fixes incorporated upstream
* Fri Oct 27 2006 hmacht@suse.de
- readd lost S2DISK_BIN and S2DISK_CONF variables
* Tue Oct 24 2006 hmacht@suse.de
- update to current CVS, some fixes incorporated upstream.
- add logging functionality
- add hook for ejecting pcmcia cards
* Mon Oct 23 2006 hmacht@suse.de
- add hook to log lsmod and free
* Wed Oct 11 2006 seife@suse.de
- small fixes, disable not yet ready logging code
* Tue Oct 10 2006 seife@suse.de
- update to current CVS, our fixes incorporated upstream.
- some additional hooks, converted from powersaved.
* Fri Oct 06 2006 seife@suse.de
- initial submission
openSUSE Build Service is sponsored by