Skip to content

Commit

Permalink
app-laptop/laptop-mode-tools: version bump
Browse files Browse the repository at this point in the history
Bug: 614766

Package-Manager: Portage-2.3.3, Repoman-2.3.1
  • Loading branch information
alonbl committed Apr 5, 2017
1 parent 07c8ac9 commit 82073bd
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-laptop/laptop-mode-tools/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST laptop-mode-tools_1.70.tar.gz 116624 SHA256 12cde7dbec8c35201efab96187be75ec84e0a2424494852413f21be1b7bc6a11 SHA512 755e2d94b63bb2a6e5362365f11181374c5fe159b508076f5def91c4df93983fa3e2553bbd94ae0b5bb4690aa7fb0881eafe3f4dcc7c8e77a8b72de23f6a21c5 WHIRLPOOL a70b0e3353877ffedd87ed3f72f1239addd34e8fecfd0e54b98c328a1f4a48a87a2f278fa4afa227452eb5f874bd58912a1ddf8ae2f385636c6bb3a552ce7b3a
DIST laptop-mode-tools_1.71.tar.gz 118833 SHA256 3aa122f876ef191e2501f550363724e30d20646637cff0de7147124c867166f9 SHA512 67ef4ed4c80f3a64ab9f0f9003d415f9e8759fd0ee1c7a82837d423a0e7aeb03ab95724afd89ae223f954ae0baec5830c8fa600bd6e2e351aead83a656f9b665 WHIRLPOOL 9c26c546f75f45b46b9b9e34a5ac435f58952e4d70b8db02c86170b4026b00112fb4044e41130dbc4f74326e22b39e0b78eeee2ba935179150441e9b5d41c884
94 changes: 94 additions & 0 deletions app-laptop/laptop-mode-tools/laptop-mode-tools-1.71.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Copyright 1999-2017 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 scsi"

RDEPEND="net-wireless/wireless-tools
sys-apps/iproute2
sys-apps/ethtool
sys-apps/hdparm
sys-apps/which
acpi? ( sys-power/acpid )
apm? ( sys-apps/apmd )
bluetooth? ( net-wireless/bluez:= )
scsi? ( sys-apps/sdparm )"
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
}

0 comments on commit 82073bd

Please sign in to comment.