File pm-utils.spec of Package pm-utils
#
# spec file for package pm-utils
#
# Copyright (c) 2012 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/
#
%define pm_libdir %{_prefix}/lib/%{name}/
%define pm_quirkdbdir %{pm_libdir}/video-quirks
%define pm_sysconfdir %{_sysconfdir}/pm/config.d/
%define gitversion 9
Name: pm-utils
Version: 1.4.1
Release: 0
Summary: Tools to suspend and hibernate computers
License: GPL-2.0+
Group: System/Base
Url: http://pm-utils.freedesktop.org/wiki/
Source0: %{name}-%{version}-suse-%{gitversion}.tar.bz2
# http://gitorious.org/opensuse/pm-utils-suse
Source1: http://pm-utils.freedesktop.org/releases/pm-quirks-20100316.tar.bz2
Source2: rc.cpufreq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq
# hooks requires some external tools
Requires: coreutils
Requires: ethtool
Requires: gawk
Requires: grep
Requires: module-init-tools
Requires: sed
Requires: upower
%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>
%package ndiswrapper
Summary: The pm-utils hook for ndiswrapper
Group: System/Base
Supplements: ndiswrapper
Requires: %{name} = %{version}
%description ndiswrapper
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. This package installs the 75ndiswrapper hook.
%prep
%setup -n %{name} -a 1
%build
%{configure} \
--docdir=%{_defaultdocdir}/%{name} \
--libdir=%{_prefix}/lib
%{__make} -d
%install
%{makeinstall}
# bnc#663067
%{__rm} %{buildroot}/%{pm_libdir}/power.d/harddrive
#FIXME: should be installed by make install
%{__install} -m 644 man/*.1 %{buildroot}/%{_mandir}/man1
%{__install} -m 644 man/*.8 %{buildroot}/%{_mandir}/man8
#quirks
%{__install} -d -m 0755 %{buildroot}%{pm_quirkdbdir}
%{__install} -m 0644 *.quirkdb %{buildroot}%{pm_quirkdbdir}
#SUSE hooks
%{__install} -m 0755 pm/sleep.d/02rtcwake %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/06autofs %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/30s2disk-check %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/45pcmcia %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/50rcnetwork %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/75ndiswrapper %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/80acpi-fan %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/80videobios %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0755 pm/sleep.d/99info %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0644 pm/config.d/* %{buildroot}/%{pm_sysconfdir}/
# powersave command is back
%{__install} -m 0755 bin/powersave %{buildroot}/%{_bindir}
%{__install} -d -m 0755 %{buildroot}/%{_localstatedir}/log
touch %{buildroot}/%{_localstatedir}/log/pm-suspend.log
# changing libdir in configure has the side-effect of misinstalling the
# pkg-config file (/usr/lib/pkgconfig is not searched on x86_64). Since we have
# no arch-specific data, we put it in datadir.
%{__install} -d -m 0755 %{buildroot}%{_datadir}/pkgconfig
mv %{buildroot}%{_prefix}/lib/pkgconfig/%{name}.pc %{buildroot}%{_datadir}/pkgconfig
# install cpufreq init script
install -D -m 0755 %{S:2} %{buildroot}%{_sysconfdir}/init.d/cpufreq
install -d -m 0755 %{buildroot}%{_sbindir}
ln -sf %{_sysconfdir}/init.d/cpufreq %{buildroot}%{_sbindir}/rccpufreq
%clean
rm -rf %{buildroot}
%preun
%stop_on_removal cpufreq
%post
%fillup_and_insserv -f -y cpufreq
%triggerun -- %{name} < 1.4.1-3
# Forcefully enable the service on upgrades from versions where the service
# didn't exist or wasn't necessarily enabled by default. Without this, on
# upgrades, the service will not be enabled.
%insserv_force_if_yast cpufreq
%postun
%restart_on_update cpufreq
%insserv_cleanup
%files
%defattr (-,root,root)
%doc README AUTHORS README.smart-suspend-to-RAM
%attr(0755,root,root) %{_bindir}/*
%{_sbindir}/*
%config %{_sysconfdir}/init.d/cpufreq
%{_sysconfdir}/pm/
%config(noreplace) %{_sysconfdir}/pm/config.d/rtcwake.config
%{pm_libdir}
%exclude %{pm_libdir}/sleep.d/75ndiswrapper
%{_mandir}/man1/*
%{_mandir}/man8/*
%ghost %verify(not md5 size mtime) /var/log/pm-suspend.log
%{_datadir}/pkgconfig/%{name}.pc
%files ndiswrapper
%defattr (-,root,root)
%{pm_libdir}/sleep.d/75ndiswrapper
%changelog