mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-23 05:53:12 -04:00
sys-power/tlp: Fix systemd support
Prior to this change, systemd units were not properly installed. Additional style and simplification fixes as needed. Signed-off-by: Jay Faulkner <jay@jvf.cc>
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
diff --git a/Makefile b/Makefile
|
|
||||||
index b81451c..d154b6b 100644
|
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -14,10 +14,10 @@ TLP_CONFDIR ?= /etc/tlp.d
|
|
||||||
TLP_CONFDEF ?= /usr/share/tlp/defaults.conf
|
|
||||||
TLP_CONFREN ?= /usr/share/tlp/rename.conf
|
|
||||||
TLP_CONF ?= /etc/default/tlp
|
|
||||||
-TLP_SYSD ?= /lib/systemd/system
|
|
||||||
-TLP_SDSL ?= /lib/systemd/system-sleep
|
|
||||||
+TLP_SYSD ?= /@LIBDIR@/systemd/system
|
|
||||||
+TLP_SDSL ?= /@LIBDIR@/systemd/system-sleep
|
|
||||||
TLP_SYSV ?= /etc/init.d
|
|
||||||
-TLP_ELOD ?= /lib/elogind/system-sleep
|
|
||||||
+TLP_ELOD ?= /@LIBDIR@/elogind/system-sleep
|
|
||||||
TLP_SHCPL ?= /usr/share/bash-completion/completions
|
|
||||||
TLP_MAN ?= /usr/share/man
|
|
||||||
TLP_META ?= /usr/share/metainfo
|
|
||||||
@@ -20,29 +20,14 @@ RDEPEND="virtual/udev
|
|||||||
systemd? ( sys-apps/systemd )"
|
systemd? ( sys-apps/systemd )"
|
||||||
DEPEND="${RDEPEND}"
|
DEPEND="${RDEPEND}"
|
||||||
REQUIRED_USE="?? ( elogind systemd )"
|
REQUIRED_USE="?? ( elogind systemd )"
|
||||||
PATCHES="${FILESDIR}/${PN}-1.5.0-Makefile.patch"
|
|
||||||
CONFIG_PROTECT="/etc/tlp.conf /etc/tlp.d"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
default
|
|
||||||
sed -i "s/@LIBDIR@/$(get_libdir)/g" "${S}/Makefile"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
if use bash-completion; then export bashcomp=0; else export bashcomp=1; fi
|
|
||||||
if use elogind; then export elogind=1; else export elogind=0; fi
|
|
||||||
if use systemd; then export systemd=1; else export systemd=0; fi
|
|
||||||
|
|
||||||
emake \
|
emake \
|
||||||
DESTDIR="${D}" \
|
DESTDIR="${D}" \
|
||||||
TLP_NO_INIT=1 \
|
TLP_NO_INIT=1 \
|
||||||
TLP_NO_BASHCOMP=$bashcomp \
|
TLP_NO_BASHCOMP=$(usex bash-completion 0 1) \
|
||||||
TLP_WITH_ELOGIND=$elogind \
|
TLP_WITH_ELOGIND=$(usex elogind 1 0) \
|
||||||
TLP_WITH_SYSTEMD=$systemd \
|
TLP_WITH_SYSTEMD=$(usex systemd 1 0) \
|
||||||
install install-man
|
install install-man
|
||||||
|
|
||||||
chmod 444 "${D}/usr/share/tlp/defaults.conf" # manpage says this file should not be edited
|
chmod 444 "${D}/usr/share/tlp/defaults.conf" # manpage says this file should not be edited
|
||||||
|
|||||||
Reference in New Issue
Block a user