*/*: Bump copyright on files touched this year
[gentoo.git] / sys-power / pm-utils / pm-utils-1.4.1-r6.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit eutils multilib
6
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"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~alpha amd64 arm ia64 ~mips ppc ppc64 s390 sparc x86"
14 IUSE="alsa debug ntp video_cards_intel video_cards_radeon"
15
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(+)]
19         sys-apps/dbus
20         >=sys-apps/util-linux-2.13
21         sys-power/pm-quirks
22         alsa? ( media-sound/alsa-utils )
23         ntp? ( || ( net-misc/ntp net-misc/openntpd ) )
24         amd64? ( ${vbetool} )
25         x86? ( ${vbetool} )
26         video_cards_radeon? ( app-laptop/radeontool )"
27 DEPEND="${RDEPEND}"
28
29 DOCS="AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO"
30
31 src_prepare() {
32         local ignore="01grub"
33         use ntp || ignore+=" 90clock"
34
35         use debug && echo 'PM_DEBUG="true"' > "${T}"/gentoo
36         echo "HOOK_BLACKLIST=\"${ignore}\"" >> "${T}"/gentoo
37
38         epatch \
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
50 }
51
52 src_configure() {
53         econf --disable-doc
54 }
55
56 src_install() {
57         default
58         doman man/*.{1,8}
59
60         # Remove duplicate documentation install
61         rm -r "${ED}"/usr/share/doc/${PN}
62
63         insinto /etc/pm/config.d
64         doins "${T}"/gentoo
65
66         insinto /etc/logrotate.d
67         newins "${FILESDIR}"/${PN}.logrotate ${PN} #408091
68
69         exeinto /usr/$(get_libdir)/${PN}/sleep.d
70         doexe "${FILESDIR}"/sleep.d/50unload_alx
71
72         exeinto /usr/$(get_libdir)/${PN}/power.d
73         doexe "${FILESDIR}"/power.d/{pci_devices,usb_bluetooth}
74
75         # No longer required with current networkmanager (rm -f from debian/rules)
76         rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/55NetworkManager
77
78         # No longer required with current kernels (rm -f from debian/rules)
79         rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/49bluetooth
80
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
83
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}
87
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
90
91         # Change to executable (chmod +x from debian/rules)
92         fperms +x /usr/$(get_libdir)/${PN}/defaults
93 }