LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File pm-utils.spec of Package pm-utils (Project utilities)

#
# spec file for package pm-utils
#
# Copyright (c) 2013 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/
# Please submit patches to git://gitorious.org/opensuse/pm-utils.git,
# unless they are opensuse-version-specific.
%define gitversion 20131024

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
Source1:        http://pm-utils.freedesktop.org/releases/pm-quirks-20100316.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

PreReq:         %insserv_prereq

# hooks requires some external tools
BuildRequires:  autoconf
BuildRequires:  m4
BuildRequires:  perl
BuildRequires:  xmlto
Requires:       coreutils
Requires:       ethtool
Requires:       gawk
Requires:       grep
Requires:       modutils
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.

%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 %{?_smp_mflags}

%install
%{makeinstall}
# bnc#663067
%{__rm} -r %{buildroot}/%{pm_libdir}/power.d/
# ibm bluetooth radio state handling was fixed
# http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=208b996b6c460285650d39b2330f8ef82c007d10
%{__rm} %{buildroot}/%{pm_libdir}/sleep.d/49bluetooth
#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/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

%postun
%insserv_cleanup

%files
%defattr (-,root,root)
%doc README AUTHORS README.smart-suspend-to-RAM
%attr(0755,root,root) %{_bindir}/*
%{_sbindir}/*
%{_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