commit d26343c11b653b700ca06cea99d3230a9f0b7465
Author: Thomas Koch <linrunner@gmx.net>
Date: Wed Jan 18 18:45:28 2017 +0100
sysvinit: add chkconfig header and Makefile variable TLP_SYSV
Requested by the Fedora package maintainer for epel6 packaging.
Reference:
* Issue #248: https://github.com/linrunner/TLP/issues/248
diff --git a/Makefile b/Makefile
index 78e2269..3caf543 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ TLP_ULIB ?= /lib/udev
TLP_NMDSP ?= /etc/NetworkManager/dispatcher.d
TLP_CONF ?= /etc/default/tlp
TLP_SYSD ?= /lib/systemd/system
+TLP_SYSV ?= /etc/init.d
TLP_SHCPL ?= /usr/share/bash-completion/completions
TLP_MAN ?= /usr/share/man
@@ -21,6 +22,7 @@ _ULIB = $(DESTDIR)$(TLP_ULIB)
_NMDSP = $(DESTDIR)$(TLP_NMDSP)
_CONF = $(DESTDIR)$(TLP_CONF)
_SYSD = $(DESTDIR)$(TLP_SYSD)
+_SYSV = $(DESTDIR)$(TLP_SYSV)
_SHCPL = $(DESTDIR)$(TLP_SHCPL)
_MAN = $(DESTDIR)$(TLP_MAN)
@@ -76,7 +78,7 @@ endif
install -D -m 644 tlp.rules $(_ULIB)/rules.d/85-tlp.rules
[ -f $(_CONF) ] || install -D -m 644 default $(_CONF)
ifneq ($(TLP_NO_INIT),1)
- install -D -m 755 tlp.init $(DESTDIR)/etc/init.d/tlp
+ install -D -m 755 tlp.init $(_SYSV)/tlp
endif
ifeq ($(TLP_WITH_SYSTEMD),1)
install -D -m 644 tlp.service $(_SYSD)/tlp.service
diff --git a/tlp.init b/tlp.init
index a3e6d35..0174e39 100755
--- a/tlp.init
+++ b/tlp.init
@@ -4,6 +4,8 @@
#
# Copyright (c) 2017 Thomas Koch <linrunner at gmx.net>
# This software is licensed under the GPL v2 or later.
+#
+# chkconfig: 2345 98 01
### BEGIN INIT INFO
# Provides: tlp