]> Pileus Git - ~andy/sunrise/blob - sys-power/s2ram/s2ram-0.5.ebuild
50a73ab9102d4b9dbc26b2f31fddb3b84af372ba
[~andy/sunrise] / sys-power / s2ram / s2ram-0.5.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 inherit linux-info toolchain-funcs
6
7 MY_P=suspend-${PV}
8
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/"
12 KEYWORDS="~x86"
13
14 SLOT="0"
15 LICENSE="GPL-2"
16 IUSE=""
17
18 DEPEND="sys-apps/pciutils"
19 RDEPEND=""
20
21 S=${WORKDIR}/${MY_P}
22
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."
26
27 src_unpack() {
28         unpack ${A}
29         cd "${S}"
30         sed -i -e "s@CFLAGS :=@CFLAGS +=@" Makefile || die "sed failed in Makefile"
31 }
32
33 pkg_setup() {
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"
37         fi
38
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"
44                 fi
45         fi
46
47         linux-info_pkg_setup
48 }
49
50 src_compile() {
51         emake CC=$(tc-getCC) s2ram || die "compile failed"
52 }
53
54 src_install() {
55         dosbin s2ram || die "install failed"
56         newdoc README.s2ram-whitelist README
57 }
58
59 pkg_postinst() {
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."
63         fi
64
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"
68         fi
69
70         elog "See README in /usr/share/doc/${PF} and ${PN} -h for quick usage instructions."
71 }