1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit linux-info toolchain-funcs
9 DESCRIPTION="Suspend-to-RAM utility from Linux Suspend project"
10 SRC_URI="mirror://sourceforge/suspend/${MY_P}.tar.gz"
11 HOMEPAGE="http://en.opensuse.org/S2ram http://sf.net/projects/suspend/"
18 DEPEND="sys-apps/pciutils"
23 CONFIG_CHECK="SOFTWARE_SUSPEND"
24 ERROR_SOFTWARE_SUSPEND="The kernel has to be configured to support software suspend.
25 Set CONFIG_SOFTWARE_SUSPEND=y and recompile your kernel."
30 sed -i -e "s@CFLAGS :=@CFLAGS +=@" Makefile || die "sed failed in Makefile"
34 if kernel_is lt 2 6 17 ; then
35 eerror "2.6.17 or higher kernel is required to use ${PN}"
36 die "This will only work with recent 2.6 kernels"
39 if has_version =sys-apps/pciutils-2.2.4* ; then
40 if built_with_use --missing true =sys-apps/pciutils-2.2.4* zlib ; then
41 eerror "Compile will fail with =sys-apps/pciutils-2.2.4* emerge with USE=zlib"
42 eerror "If you dislike this, then attach a patch to Bug 128468"
43 die "You MUST build pciutils without the zlib USE flag"
51 emake CC=$(tc-getCC) s2ram || die "compile failed"
55 dosbin s2ram || die "install failed"
56 newdoc README.s2ram-whitelist README
60 if ! has_version sys-apps/vbetool ; then
61 elog "If you get blank screen on resume, then emerge sys-apps/vbetool"
62 elog "and read the supplied documentation."
65 if ! has_version app-laptop/radeontool ; then
66 elog "To control backlight on suspend with ATI Radeon Mobility graphics cards,"
67 elog "you will need to emerge app-laptop/radeontool"
70 elog "See README in /usr/share/doc/${PF} and ${PN} -h for quick usage instructions."