diff options
author | Alon Bar-Lev <alonbl@gentoo.org> | 2018-02-01 19:16:31 +0200 |
---|---|---|
committer | Alon Bar-Lev <alonbl@gentoo.org> | 2018-02-01 20:42:28 +0200 |
commit | 4cc1d20579edf1ff32cfdf5f14d8ee07099ce198 (patch) | |
tree | 2a46af4e90f743a10bc5b4393506343a6e28171f /app-laptop | |
parent | net-p2p/transmission: bump to 2.93 (diff) | |
download | gentoo-4cc1d20579edf1ff32cfdf5f14d8ee07099ce198.tar.gz gentoo-4cc1d20579edf1ff32cfdf5f14d8ee07099ce198.tar.bz2 gentoo-4cc1d20579edf1ff32cfdf5f14d8ee07099ce198.zip |
app-laptop/laptop-mode-tools: version bump
Package-Manager: Portage-2.3.19, Repoman-2.3.6
Diffstat (limited to 'app-laptop')
-rw-r--r-- | app-laptop/laptop-mode-tools/Manifest | 1 | ||||
-rw-r--r-- | app-laptop/laptop-mode-tools/laptop-mode-tools-1.72.ebuild | 91 |
2 files changed, 92 insertions, 0 deletions
diff --git a/app-laptop/laptop-mode-tools/Manifest b/app-laptop/laptop-mode-tools/Manifest index fb5890af2d0b..baa42d7e8e5f 100644 --- a/app-laptop/laptop-mode-tools/Manifest +++ b/app-laptop/laptop-mode-tools/Manifest @@ -1 +1,2 @@ DIST laptop-mode-tools_1.71.tar.gz 118833 BLAKE2B 21e6399d35d3f35dd75e5640eb50d679de87bf40435484e0c7cb67dcd0f2a794b5f14b48e375c302ef749efc38677b8abbdacfd3612206fb0125c52b9d67a89b SHA512 67ef4ed4c80f3a64ab9f0f9003d415f9e8759fd0ee1c7a82837d423a0e7aeb03ab95724afd89ae223f954ae0baec5830c8fa600bd6e2e351aead83a656f9b665 +DIST laptop-mode-tools_1.72.tar.gz 121392 BLAKE2B 7aa02fa546d04423c45c27afd7b4c79ce10cdf8e7ae986d66fb664ab5bd6a05c6ac188a456f3afd46780cec7ab74d2cd83b4ddf1e14f6dbc517442d03bb960a6 SHA512 9135df29d4076dadc805470d742007b1a25be962f4181235126d1bb697b362c646cb9c4839b57e92314b8207e23eba3618b2d985802836bcae22f6a4aceb66a5 diff --git a/app-laptop/laptop-mode-tools/laptop-mode-tools-1.72.ebuild b/app-laptop/laptop-mode-tools/laptop-mode-tools-1.72.ebuild new file mode 100644 index 000000000000..8e38fc45f3d4 --- /dev/null +++ b/app-laptop/laptop-mode-tools/laptop-mode-tools-1.72.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multilib systemd udev + +MY_P="${PN}_${PV}" + +DESCRIPTION="Linux kernel laptop_mode user-space utilities" +HOMEPAGE="https://github.com/rickysarraf/laptop-mode-tools/wiki" +SRC_URI="https://github.com/rickysarraf/${PN}/releases/download/${PV}/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="+acpi apm bluetooth" + +RDEPEND="sys-apps/iproute2 + sys-apps/ethtool + sys-apps/which + acpi? ( sys-power/acpid ) + apm? ( sys-apps/apmd ) + bluetooth? ( net-wireless/bluez:= )" +DEPEND="" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + default + # This should avoid conflict with pm-powersave wrt #327443 and #396703 + cat <<-EOF > "${T}"/${PN} + HOOK_BLACKLIST="00powersave" + EOF +} + +src_compile() { :; } + +src_install() { + DESTDIR="${D}" \ + INIT_D="none" \ + MAN_D="/usr/share/man" \ + LIB_D="/usr/$(get_libdir)" \ + UDEV_D="$(get_udevdir)" \ + SYSTEMD_UNIT_D="$(systemd_get_systemunitdir)" \ + TMPFILES_D="/usr/lib/tmpfiles.d" \ + ACPI="$(use acpi && echo force || echo disabled)" \ + PMU="$(false && echo force || echo disabled)" \ + APM="$(use apm && echo force || echo disabled)" \ + SYSTEMD=yes \ + sh ./install.sh || die + + dodoc Documentation/*.txt README.md + newinitd "${FILESDIR}"/laptop_mode.init-1.4 laptop_mode + + # See src_prepare() + insinto /etc/pm/config.d + doins "${T}"/${PN} +} + +pkg_postinst() { + if use acpi || use apm; then + if use acpi; then + daemon_name="acpid" + elif use apm; then + deamon_name="apmd" + fi + if [ "$(rc-config list default | grep laptop_mode)" = "" ] || [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then + ewarn "To enable automatic power state event handling," + ewarn "e.g. enabling laptop_mode after unplugging the battery," + ewarn "both laptop_mode and the ${daemon_name} daemon must be" + ewarn "added to default runlevel:" + if [ "$(rc-config list default | grep laptop_mode)" = "" ]; then + ewarn "# rc-update add laptop_mode default" + fi + if [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then + ewarn "# rc-update add ${daemon_name} default" + fi + fi + else + ewarn "Without USE=\"acpi\" or USE=\"apm\" ${PN} can not" + ewarn "automatically disable laptop_mode on low battery." + ewarn + ewarn "This means you can lose up to 10 minutes of work if running" + ewarn "out of battery while laptop_mode is enabled." + ewarn + ewarn "Please see laptop-mode.txt in /usr/share/doc/${PF} for further" + ewarn "information." + ewarn + fi +} |