Blob Blame History Raw
Name:           tlp
Version:        0.9
Release:        3%{?dist}
Summary:        Advanced power management tool for Linux
License:        GPLv2+
URL:            http://linrunner.de/tlp
Source0:        https://github.com/linrunner/TLP/archive/%{version}.tar.gz
#Fix for init script, will be fixed upstream:
#https://github.com/linrunner/TLP/issues/248
Patch0:         %{name}-initfix.patch

#The following requires are not detected:
Requires:       ethtool
Requires:       hdparm
Requires:       iw
Requires:       redhat-lsb-core
Requires:       rfkill
Requires:       udev
Requires:       usbutils
Requires:       pciutils
Requires:       pm-utils
Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts
# This is for /sbin/service
Requires(postun): initscripts

#Note: Conflicts with laptop-mode-tools
#Makes sure laptop_mode isn't being used:
Conflicts:      %{_sbindir}/laptop_mode

%description
TLP brings you the benefits of advanced power management for Linux
without the need to understand every technical detail. TLP comes
with a default configuration already optimized for battery life.
Also an optional install of the smartmontools package enables hard
disk SMART data in tlp-stat (smartctl).

%package rdw
Summary:        Radio Device Wizard for TLP
Requires:       NetworkManager
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description rdw
Radio Device Wizard for TLP automatically toggles wireless networking
based on dock events and the Network Manager connection status.

%prep
%autosetup -n TLP-%{version}

#Epel6 uses a different initdir than in the makefile:
sed -i "s|/etc/init.d/tlp|%{_initddir}/tlp|g" Makefile

%build
make

%install
make install DESTDIR=%{buildroot} TLP_NO_INIT=0 \
             TLP_NO_PMUTILS=0 TLP_WITH_SYSTEMD=0 \
             TLP_PLIB=%{_libdir}/pm-utils
#Install manpages:
make install-man DESTDIR=%{buildroot}

%files
%config(noreplace) %{_sysconfdir}/default/tlp
%doc COPYING LICENSE README
%{_initddir}/tlp
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/man*/*
%{_datadir}/tlp-pm
%{_libdir}/pm-utils/sleep.d/49tlp
/lib/udev/rules.d/85-tlp.rules
/lib/udev/tlp-usb-udev
%{_datadir}/bash-completion/completions/*

%files rdw
%doc COPYING LICENSE README
%{_sysconfdir}/NetworkManager/dispatcher.d/99tlp-rdw-nm
/lib/udev/rules.d/85-tlp-rdw.rules
/lib/udev/tlp-rdw-udev

%post
/sbin/chkconfig --add tlp

%preun
if [ $1 -eq 0 ] ; then
    /sbin/service tlp stop >/dev/null 2>&1
    /sbin/chkconfig --del tlp
fi

%postun
if [ "$1" -ge "1" ] ; then
    /sbin/service tlp condrestart >/dev/null 2>&1 || :
fi

%changelog
* Tue Jan 17 2017 Jeremy Newton <alexjnewt at hotmail dot com> - 0.9-3
- Init script fix (missing chkconfig)
- SysV fixes (added proper requires)
- Removed systemd script from rdw

* Tue Jan 17 2017 Jeremy Newton <alexjnewt at hotmail dot com> - 0.9-2
- Remove kernel-tools req (not in epel6)
- Revert back to arched package (forgot that pm-utils still needs this)

* Mon Jan 16 2017 Jeremy Newton <alexjnewt at hotmail dot com> - 0.9-1
- Update to 0.9

* Mon Nov 17 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.6-4
- Redundant Dependancy

* Tue Nov 4 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.6-3
- Wrong udev dir for el6
- Preset shouldn't be on el6 (f18+, EPEL 7+)
- Missing dep (pciutils)
- Bash completion should be in etc (el6 only)

* Tue Oct 28 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.6-2
- Add pmutils for suspend and resume

* Mon Oct 27 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.6-1
- New Upstream Version

* Mon Apr 21 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.5-2
- Various tweaking
- Move bashcompletion file to silence rpmlint warning

* Sun Apr 20 2014 Jeremy Newton <alexjnewt@hotmail.com> - 0.5-1
- Initial fedora package