2008-04-01 16:02:54 +02:00
|
|
|
{ stdenv, fetchurl, gawk }:
|
|
|
|
|
|
|
|
let version = "1.98.1";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hibernate-${version}";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.tuxonice.net/downloads/all/hibernate-script-${version}.tar.gz";
|
|
|
|
sha256 = "1xpc2i16jczc3nhvxlkn6fb044srqrh528gnp92cwy4hxf2nzi1z";
|
|
|
|
};
|
|
|
|
|
2008-04-01 19:31:31 +02:00
|
|
|
patches = [ ./install.patch ./gen-manpages.patch ./hibernate.patch ];
|
2008-04-01 16:02:54 +02:00
|
|
|
|
|
|
|
buildInputs = [ gawk ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# FIXME: Storing config files under `$out/etc' is not very useful.
|
2008-04-01 19:31:31 +02:00
|
|
|
|
|
|
|
substituteInPlace "hibernate.sh" --replace \
|
|
|
|
'SWSUSP_D="/etc/hibernate"' "SWSUSP_D=\"$out/etc/hibernate\""
|
|
|
|
|
|
|
|
# Remove all references to `/bin' and `/sbin'.
|
|
|
|
for i in scriptlets.d/*
|
|
|
|
do
|
|
|
|
substituteInPlace "$i" --replace "/bin/" "" --replace "/sbin/" ""
|
|
|
|
done
|
|
|
|
|
2008-04-01 16:02:54 +02:00
|
|
|
PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh
|
2008-04-01 19:31:31 +02:00
|
|
|
|
|
|
|
ln -s "$out/share/hibernate/scriptlets.d" "$out/etc/hibernate"
|
2008-04-01 16:02:54 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The `hibernate' script for swsusp and Tux-on-Ice";
|
|
|
|
longDescription = ''
|
|
|
|
This package provides the `hibernate' script, a command-line utility
|
|
|
|
that saves the computer's state to disk and switches it off, turning
|
|
|
|
it into "hibernation". It works both with Linux swsusp and Tux-on-Ice.
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = "GPLv2+";
|
|
|
|
homepage = http://www.tuxonice.net/;
|
|
|
|
};
|
|
|
|
}
|