# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit toolchain-funcs eutils DESCRIPTION="Userspace Software Suspend and S2Ram" HOMEPAGE="http://suspend.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" DEPEND="sys-apps/pciutils" src_unpack() { unpack ${A} cd ${S} # Generic Makefile fixes, sent upstream epatch ${FILESDIR}/${P}-build.patch } src_compile() { emake CC=$(tc-getCC) CC_FLAGS= LD_FLAGS= || die } src_install() { emake install SUSPEND_DIR=/usr/sbin DESTDIR=${D} || die dosbin ${FILESDIR}/create-resume-initrd.sh dodoc ChangeLog HOWTO README README.s2ram-whitelist ReleaseNotes TODO } pkg_postinst() { einfo '' elog 'This package provides s2ram for suspending to RAM and s2disk for' elog 'hibernation. Both require CONFIG_SOFTWARE_SUSPEND=y in the' elog 'kernel, but only s2disk requires 3 additional steps:' einfo '' elog '1: For initrd to work (for resuming from disk), you need the' elog 'following options in your kernel:' elog ' CONFIG_BLK_DEV_INITRD=y' elog ' CONFIG_BLK_DEV_RAM=y' elog ' CONFIG_BLK_DEV_RAM_SIZE >= 2048' elog 'The script to create initrd images included in this package also' elog 'needs CONFIG_BLK_DEV_LOOP=y and CONFIG_EXT2_FS=y.' einfo '' elog '2: Edit the configuration file at /etc/suspend.conf and set the' elog 'value of "resume device" to your swap partition. The chosen' elog 'device should be no less than 1/2 the size of your RAM.' einfo '' elog '3: You will then need to create an initrd for your bootloader.' elog 'A utility called create-resume-initrd.sh has been included' elog 'for this purpose.' einfo '' }