1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils multilib
7 DESCRIPTION="Suspend and hibernation utilities"
8 HOMEPAGE="https://pm-utils.freedesktop.org/"
9 SRC_URI="https://pm-utils.freedesktop.org/releases/${P}.tar.gz"
13 KEYWORDS="~alpha amd64 arm ia64 ~mips ppc ppc64 s390 sparc x86"
14 IUSE="alsa debug ntp video_cards_intel video_cards_radeon"
16 vbetool="!video_cards_intel? ( sys-apps/vbetool )"
17 RDEPEND="!<app-laptop/laptop-mode-tools-1.55-r1
18 !sys-power/powermgmt-base[-pm-utils(+)]
20 >=sys-apps/util-linux-2.13
22 alsa? ( media-sound/alsa-utils )
23 ntp? ( || ( net-misc/ntp net-misc/openntpd ) )
26 video_cards_radeon? ( app-laptop/radeontool )"
29 DOCS="AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO"
33 use ntp || ignore+=" 90clock"
35 use debug && echo 'PM_DEBUG="true"' > "${T}"/gentoo
36 echo "HOOK_BLACKLIST=\"${ignore}\"" >> "${T}"/gentoo
39 "${FILESDIR}"/${PV}-bluetooth-sync.patch \
40 "${FILESDIR}"/${PV}-disable-sata-alpm.patch \
41 "${FILESDIR}"/${PV}-fix-intel-audio-powersave-hook.patch \
42 "${FILESDIR}"/${PV}-logging-append.patch \
43 "${FILESDIR}"/${PV}-fix-alpm-typo.patch \
44 "${FILESDIR}"/${PV}-inhibit-on-right-status.patch \
45 "${FILESDIR}"/${PV}-ignore-led-failure.patch \
46 "${FILESDIR}"/${PV}-run-hook-logging.patch \
47 "${FILESDIR}"/${PV}-suspend-hybrid.patch \
48 "${FILESDIR}"/${PV}-uswsusp-hibernate-mode.patch \
49 "${FILESDIR}"/${PV}-xfs_buffer_arguments.patch
60 # Remove duplicate documentation install
61 rm -r "${ED}"/usr/share/doc/${PN}
63 insinto /etc/pm/config.d
66 insinto /etc/logrotate.d
67 newins "${FILESDIR}"/${PN}.logrotate ${PN} #408091
69 exeinto /usr/$(get_libdir)/${PN}/sleep.d
70 doexe "${FILESDIR}"/sleep.d/50unload_alx
72 exeinto /usr/$(get_libdir)/${PN}/power.d
73 doexe "${FILESDIR}"/power.d/{pci_devices,usb_bluetooth}
75 # No longer required with current networkmanager (rm -f from debian/rules)
76 rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/55NetworkManager
78 # No longer required with current kernels (rm -f from debian/rules)
79 rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/49bluetooth
81 # Punt HAL related file wrt #401257 (rm -f from debian/rules)
82 rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/hal-cd-polling
84 # Punt hooks which have shown to not reduce, or even increase power usage
85 # (rm -f from debian rules)
86 rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/{journal-commit,readahead}
88 # Remove hooks which are not stable enough yet (rm -f from debian/rules)
89 rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/harddrive
91 # Change to executable (chmod +x from debian/rules)
92 fperms +x /usr/$(get_libdir)/${PN}/defaults