File laptop-mode-tools.spec of Package laptop-mode-tools

#
# spec file for package laptop-mode-tools
#
# Copyright (c) 2014 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/
#


Name:           laptop-mode-tools
Version:        1.62
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        The Laptop Mode Tools
License:        GPL-2.0+
Group:          System/Base
Url:            http://www.samwel.tk/laptop_mode/
PreReq:         %insserv_prereq
Source:         %{name}_%{version}.tar.gz
#Source1:        laptop-mode-tools.pm-utils-hook
Source2:        README.SUSE
Patch1:         laptop-mode-1.53-install_sh.diff
Patch2:         laptop-mode-1.53_conf.diff
Patch3:         laptop-mode-1.49-initscript.diff
Patch4:         laptop-mode-1.49-new-dirty-ratio-defaults.diff
Patch6:         laptop-mode-1.53-moblin-enable-intel-hda-powersave.patch
Patch7:         laptop-mode-1.62-customize-installation-of-udev-systemd-files.patch
Patch8:         laptop-mode-1.62-blacklist-usbhid.patch
Patch9:         laptop-mode-1.62-skip-directories.patch
BuildArch:      noarch
#BuildRequires:  pm-utils

%if %suse_version > 1220
%define         _lib /usr/lib
%else
%define         _lib /lib
%endif

%description
Laptop Mode Tools is a laptop power saving package for Linux systems.
It allows you to extend the battery life of your laptop, in several
ways. It is the primary way to enable the Laptop Mode feature of the
Linux kernel, which lets your hard drive spin down. In addition, it
allows you to tweak a number of other power-related settings using a
simple configuration file.



Authors:
--------
    Bart Samwel <bart at samwel.tk>

%prep
%setup -n %{name}_%{version} -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
cp %{S:2} .

%build

%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
DESTDIR=$RPM_BUILD_ROOT MAN_D=%{_mandir} INSTALL=install INIT_D=/etc/init.d LIB_D=%{_lib} ACPI=DISABLED PMU=disabled APM=disabled ./install.sh
chmod 644 $RPM_BUILD_ROOT/%{_mandir}/man8/*
ln -s /etc/init.d/laptop-mode %{buildroot}/usr/sbin/rclaptop-mode
rm %{buildroot}/usr/lib/pm-utils/sleep.d/01laptop-mode

%clean
rm -rf "$RPM_BUILD_ROOT"

%post
%{insserv_force_if_yast laptop-mode}

%preun
%stop_on_removal

%postun
%restart_on_update
%insserv_cleanup

%files
%defattr(-,root,root)
%dir /etc/laptop-mode
%config /etc/laptop-mode/*
/etc/init.d/laptop-mode
%config /etc/udev/rules.d/99-laptop-mode.rules
/usr/sbin/*
%dir /usr/share/laptop-mode-tools/
%dir /usr/share/laptop-mode-tools/modules/
%dir /usr/share/laptop-mode-tools/module-helpers/
/usr/share/laptop-mode-tools/modules/*
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
/usr/share/laptop-mode-tools/module-helpers/pm-helper
/usr/share/laptop-mode-tools/module-helpers/pm-hibernate
/usr/share/laptop-mode-tools/module-helpers/pm-suspend
%doc /usr/share/man/man8/*
%doc README.SUSE
%dir %{_lib}/udev
%{_lib}/udev/lmt-udev
%dir /usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/laptop-mode.conf
%dir %{_lib}/systemd/system 
%config %{_lib}/systemd/system/laptop-mode.service
/etc/udev
/etc/udev/rules.d

%changelog
openSUSE Build Service is sponsored by