summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-04-01 14:02:54 +0000
committerLudovic Courtès <ludo@gnu.org>2008-04-01 14:02:54 +0000
commit415a837c3d7a79ccf61f32ab80f8577686d70778 (patch)
tree05b5fc19600f0d449d2ad569e6bc577f522505f0 /pkgs/os-specific/linux
parentaa720c84313cada98e63138b03e24c3edbe5b117 (diff)
downloadnixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar.gz
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar.bz2
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar.lz
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar.xz
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.tar.zst
nixpkgs-415a837c3d7a79ccf61f32ab80f8577686d70778.zip
Add `hibernate', an swsusp/Tux-on-Ice convenience script.
svn path=/nixpkgs/trunk/; revision=11438
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/hibernate/default.nix32
-rw-r--r--pkgs/os-specific/linux/hibernate/gen-manpages.patch11
-rw-r--r--pkgs/os-specific/linux/hibernate/install.patch11
3 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/hibernate/default.nix b/pkgs/os-specific/linux/hibernate/default.nix
new file mode 100644
index 00000000000..2b6a9bda374
--- /dev/null
+++ b/pkgs/os-specific/linux/hibernate/default.nix
@@ -0,0 +1,32 @@
+{ 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";
+    };
+
+    patches = [ ./install.patch ./gen-manpages.patch ];
+
+    buildInputs = [ gawk ];
+
+    installPhase = ''
+      # FIXME: Storing config files under `$out/etc' is not very useful.
+      PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh
+    '';
+
+    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/;
+    };
+  }
diff --git a/pkgs/os-specific/linux/hibernate/gen-manpages.patch b/pkgs/os-specific/linux/hibernate/gen-manpages.patch
new file mode 100644
index 00000000000..cdbacc86baf
--- /dev/null
+++ b/pkgs/os-specific/linux/hibernate/gen-manpages.patch
@@ -0,0 +1,11 @@
+--- hibernate-script-1.98.1/gen-manpages.sh	2008-03-31 09:40:29.000000000 +0200
++++ hibernate-script-1.98.1/gen-manpages.sh	2008-04-01 15:58:11.000000000 +0200
+@@ -254,7 +254,7 @@ BEGIN {
+ }
+ 
+ # Create a copy of hibernate.sh with only the help items
+-TMPF=`mktemp /tmp/tmp.hibernate.XXXXXX`
++TMPF=`mktemp "$TMPDIR/tmp.hibernate.XXXXXX"`
+ awk '{
+     if ((substr($0, 1, 1) != "#") && (match($0, "AddConfigHelp") || match($0, "AddOptionHelp")) && (match($0, "\\(\\)") == 0)) {
+         print $0;
diff --git a/pkgs/os-specific/linux/hibernate/install.patch b/pkgs/os-specific/linux/hibernate/install.patch
new file mode 100644
index 00000000000..ae296b955ac
--- /dev/null
+++ b/pkgs/os-specific/linux/hibernate/install.patch
@@ -0,0 +1,11 @@
+--- hibernate-script-1.98.1/install.sh	2008-03-31 09:40:29.000000000 +0200
++++ hibernate-script-1.98.1/install.sh	2008-04-01 15:50:46.000000000 +0200
+@@ -63,7 +63,7 @@ fi
+ cp -a blacklisted-modules $BLACKLIST
+ 
+ # Test if they have anything in there, and warn them
+-if /bin/ls $OLD_SCRIPTLET_DIR/* > /dev/null 2>&1 ; then
++if ls $OLD_SCRIPTLET_DIR/* > /dev/null 2>&1 ; then
+     echo "  **"
+     echo "  ** You have scriptlets already installed in $OLD_SCRIPTLET_DIR"
+     echo "  ** Since version 0.95, these have moved to $SCRIPTLET_DIR."