File pm-utils.spec of Package pm-utils.import5908
#
# 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/
Name: pm-utils
Version: 1.4.1
Release: 5.<RELEASE13>
Summary: Tools to suspend and hibernate computers
License: GPL-2.0+
Group: System/Base
Url: http://pm-utils.freedesktop.org/wiki/
Source0: %{name}-%{version}.tar.bz2
# http://gitorious.org/opensuse/pm-utils-suse
Source1: pm-utils-suse-c4a2acedc2a25d61c7a82f050a2d98d2690ed16d.tar.bz2
Source2: http://pm-utils.freedesktop.org/releases/pm-quirks-20100316.tar.bz2
Source3: rc.cpufreq
#PATCH-FIX-OPENSUSE: fixes a dbus-send call
Patch0: pm-utils-1.2.6.1-fix-broken-dbus-send.diff
#PATCH-FIX-OPENSUSE: make the uswsusp module default on SUSE and port the "smart" behavior
Patch1: pm-utils-1.3.0-suse-smart-uswsusp.patch
#PATCH-FIX-OPENSUSE: add some aditional config variables for pm-utils-suse
Patch2: pm-utils-1.4.1-suse-config.patch
#PATCH-FIX-OPENSUSE: more SUSE friendly grub handler
Patch3: pm-utils-1.3.0-suse-grub.patch
#PATCH-FIX-OPENSUSE: setup also kernel loglevel to show up the progress bar
Patch4: pm-utils-1.3.0-suse-logging.patch
#PATCH-FIX-OPENSUSE: export SUSE_IGNORE_FBMODES to workaround bnc#304995
Patch5: pm-utils-1.3.0-suse-directfb-ignore-fbmodes.patch
#PATCH-FIX-OPENSUSE: Update NetworkManager's Sleep method bnc#735837
Patch6: pm-utils-1.4.1-networkmanager.patch
#PATCH-FIX-OPENSUSE: Fix 50rcnetwork bnc#749031
Patch7: pm-utils-dhcp-interfaces.patch
Patch8: pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch
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 -q -b 1 -a 2
%patch0 -p1 -b .broken-dbus
%patch1 -p1 -b .smart-swsusp
%patch2 -p1 -b .suse-config
%patch3 -p1 -b .suse-grub
%patch4 -p1 -b .suse-logging
%patch5 -p1 -b .directfb-ignore-fbmodes
%patch6 -p1 -b .networkmanager
cd ..
%patch7 -p1
%patch8 -p0
%build
%{configure} \
--docdir=%{_defaultdocdir}/%{name} \
--libdir=%{_prefix}/lib
%{__make}
%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
pushd ../pm-utils-suse
%{__install} -m 0755 hooks/sleep.d/* %{buildroot}/%{pm_libdir}/sleep.d/
%{__install} -m 0644 hooks/config.d/* %{buildroot}/%{pm_sysconfdir}/
# powersave command is back
%{__install} -m 0755 bin/powersave %{buildroot}/%{_bindir}
popd
%{__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:3} %{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 ChangeLog AUTHORS ../pm-utils-suse/doc/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