File tlp.spec of Package TLP
# spec file for the tlp scripts
#
# Copyright 2011, 2012 Christian Dersch <chrisdersch~at~googlemail~dot~com>
#
# This file is published under the same license terms as the package itself.
# (GPLv2)
#
Name: tlp
Version: 0.3.9
Release: 1
Summary: Advanced energy-saving tools for laptops
Group: Hardware/Mobile
License: GPLv2
URL: https://github.com/linrunner/TLP/wiki/TLP-Linux-Advanced-Power-Management
Source: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: pm-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: udev dmidecode hdparm perl pm-utils rfkill wireless-tools
%description
TLP is a collection of scripts enabling laptop-mode and
implementing power save features for laptop hardware.
For some additional features supported by IBM/Lenovo ThinkPads,
the tp_smapi package matching your kernel is required.
%prep
%setup -q -n TLP-%{version}
%build
make
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %buildroot/%{_mandir}/man1
mkdir -p %buildroot/%{_mandir}/man8
install -m 0644 man/*.1 %buildroot/%{_mandir}/man1
install -m 0644 man/*.8 %buildroot/%{_mandir}/man8
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/man1/*
%{_mandir}/man8/*
# The following hardcoded paths are required to get the scripts working
%dir /usr/lib/tlp-pm
/usr/lib/tlp-pm/tlp-functions
/usr/lib/tlp-pm/tlp-nop
/usr/lib/tlp-pm/tlp-rf-func
/usr/lib/pm-utils/power.d/zztlp
/usr/lib/pm-utils/sleep.d/49bay
/usr/lib/pm-utils/sleep.d/49wwan
/lib/udev/rules.d/40-tlp.rules
/lib/udev/tlp-usb-udev
%{_sysconfdir}/bash_completion.d/tlp
%{_sysconfdir}/init.d/tlp
#%{_sysconfdir}/xdg/autostart/tlp.desktop
%config(noreplace) %{_sysconfdir}/default/tlp
%doc COPYING LICENSE README
%post
# Disable conflicting pm-utils hooks
for i in 95hdparm-apm disable_wol hal-cd-polling intel-audio-powersave harddrive \
laptop-mode journal-commit pci_devices pcie_aspm readahead sata_alpm \
sched-powersave usb_bluetooth wireless xfs_buffer; do
if [ -x /usr/lib/pm-utils/power.d/$i ]; then
ln -sf /usr/lib/tlp-pm/tlp-nop /etc/pm/power.d/$i
fi
done
%fillup_and_insserv -y tlp
%preun
%stop_on_removal
%postun
# Remove pm-utils hook disablers
for i in 95hdparm-apm disable_wol hal-cd-polling intel-audio-powersave harddrive \
laptop-mode journal-commit pci_devices pcie_aspm readahead sata_alpm \
sched-powersave usb_bluetooth wireless xfs_buffer; do
if [ "$(readlink /etc/pm/power.d/$i)" = "/usr/lib/tlp-pm/tlp-nop" ]; then
rm /etc/pm/power.d/$i
fi
done
%restart_on_update
%insserv_cleanup
%package rdw
Summary: Radio Device Wizard for TLP
Group: Hardware/Mobile
Requires: tlp NetworkManager
BuildRequires: NetworkManager
%description rdw
Radio device wizard: switches radios upon network connect/disconnect and
dock/undock events (depends on Network Manager).
%files rdw
%defattr(-,root,root,-)
%{_sysconfdir}/NetworkManager/dispatcher.d/99tlp-rdw-nm
/lib/udev/rules.d/40-tlp-rdw.rules
/lib/udev/tlp-rdw-udev
/usr/lib/pm-utils/sleep.d/48tlp-rdw-lock
%dir /etc/acpi/
%dir /etc/acpi/events/
%{_sysconfdir}/acpi/events/thinkpad-radiosw
%{_sysconfdir}/acpi/thinkpad-radiosw.sh
%attr(755,root,root) /usr/lib/tlp-pm/tpacpi-bat
%doc COPYING LICENSE README
%changelog
* Thu Jul 04 2013 Marc Collin <marc.collin~at~laboiteaprog~dot~com>
- Upgrade to version 0.3.9
* Fri Apr 06 2012 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Upgrade to version 0.3.6
- Added subpackage tlp-rdw for the new Radio Device Wizard.
* Tue Dec 20 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Upgrade to version 0.3.5
* Thu Nov 24 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Downgrade to version 0.3.3 due to problems with the non-official 0.3.4
* Thu Nov 17 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Upgrade to version 0.3.4
* Wed Jul 27 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Fixed issue with tlp-stat (usb) (tlp 0.3.2-4, thanks to linrunner)
- Fixed issue in spec, now config file won't be overwritten after updates
* Mon Jul 25 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Fixed issue with usb suspend (thanks to linrunner)
- Corrected the makefile_suse.diff patch (wrong path)
* Mon Jul 18 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Upgrade to version 0.3.2
* Sun May 01 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Upgrade to version 0.3.0.201
* Mon Mar 21 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Fixed wrong path for scripts in /usr/lib/pm-utils/
* Sun Mar 20 2011 Christian Dersch <chrisdersch~at~googlemail~dot~com>
- Initial build