summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/X11/xmacro/default.nix7
-rw-r--r--pkgs/tools/X11/xnee/default.nix8
-rw-r--r--pkgs/tools/archivers/zip/builder.sh7
-rw-r--r--pkgs/tools/archivers/zip/default.nix17
-rw-r--r--pkgs/tools/backup/bacula/default.nix20
-rw-r--r--pkgs/tools/backup/bup/default.nix23
-rw-r--r--pkgs/tools/cd-dvd/xorriso/default.nix4
-rw-r--r--pkgs/tools/filesystems/dosfstools/default.nix4
-rw-r--r--pkgs/tools/filesystems/encfs/default.nix6
-rw-r--r--pkgs/tools/filesystems/sshfs-fuse/default.nix4
-rw-r--r--pkgs/tools/filesystems/xtreemfs/default.nix79
-rw-r--r--pkgs/tools/misc/aws-mturk-clt/default.nix48
-rw-r--r--pkgs/tools/misc/fdupes/default.nix20
-rw-r--r--pkgs/tools/misc/heimdall/default.nix57
-rw-r--r--pkgs/tools/misc/mc/default.nix66
-rw-r--r--pkgs/tools/misc/parallel/default.nix4
-rw-r--r--pkgs/tools/misc/partition-manager/default.nix4
-rw-r--r--pkgs/tools/misc/system-config-printer/default.nix39
-rw-r--r--pkgs/tools/networking/atftp/default.nix55
-rw-r--r--pkgs/tools/networking/isync/default.nix1
-rw-r--r--pkgs/tools/networking/isync/isync-recursice-imap.patch114
-rw-r--r--pkgs/tools/networking/netboot/default.nix60
-rw-r--r--pkgs/tools/networking/p2p/gtk-gnutella/builder.sh9
-rw-r--r--pkgs/tools/networking/p2p/gtk-gnutella/default.nix30
-rw-r--r--pkgs/tools/networking/pdsh/default.nix20
-rw-r--r--pkgs/tools/networking/s3cmd/default.nix25
-rw-r--r--pkgs/tools/networking/tftp-hpa/default.nix48
-rw-r--r--pkgs/tools/package-management/cabal-install/0.10.2.nix19
-rw-r--r--pkgs/tools/package-management/cabal-install/0.6.2.nix19
-rw-r--r--pkgs/tools/package-management/cabal-install/0.8.0.nix19
-rw-r--r--pkgs/tools/package-management/cabal-install/0.8.2.nix19
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix6
-rw-r--r--pkgs/tools/security/gnupg/default.nix4
-rw-r--r--pkgs/tools/security/pinentry/default.nix (renamed from pkgs/tools/misc/pinentry/default.nix)2
-rw-r--r--pkgs/tools/security/pinentry/duplicate-glib-defs.patch (renamed from pkgs/tools/misc/pinentry/duplicate-glib-defs.patch)0
-rw-r--r--pkgs/tools/security/polkit-gnome/default.nix (renamed from pkgs/tools/misc/polkit-gnome/default.nix)0
-rw-r--r--pkgs/tools/security/polkit-kde-agent/default.nix21
-rw-r--r--pkgs/tools/security/super/default.nix29
-rw-r--r--pkgs/tools/system/lxc/default.nix6
-rw-r--r--pkgs/tools/system/sg3_utils/default.nix4
-rw-r--r--pkgs/tools/system/sleuthkit/default.nix48
-rw-r--r--pkgs/tools/system/syslog-ng/default.nix (renamed from pkgs/tools/misc/syslog-ng/default.nix)2
-rw-r--r--pkgs/tools/system/tree/default.nix57
-rw-r--r--pkgs/tools/text/dos2unix/default.nix41
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch238
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch28
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch88
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch93
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch141
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1.patch49
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch42
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-manpage.patch12
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch15
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch28
-rw-r--r--pkgs/tools/text/kdiff3/default.nix4
-rw-r--r--pkgs/tools/text/mairix/default.nix20
-rw-r--r--pkgs/tools/text/unix2dos/default.nix37
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch42
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch29
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch94
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch146
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch20
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch29
-rw-r--r--pkgs/tools/typesetting/lhs2tex/default.nix11
-rw-r--r--pkgs/tools/video/dvgrab/default.nix34
-rw-r--r--pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix2
-rw-r--r--pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix2
67 files changed, 944 insertions, 1335 deletions
diff --git a/pkgs/tools/X11/xmacro/default.nix b/pkgs/tools/X11/xmacro/default.nix
index 1b18138f28b3..12bb2903107c 100644
--- a/pkgs/tools/X11/xmacro/default.nix
+++ b/pkgs/tools/X11/xmacro/default.nix
@@ -8,7 +8,12 @@ stdenv.mkDerivation {
     md5 = "d2956b82f3d5380e58a75ccc721fb746";
   };
 
-  preBuild = " sed -e 's/-pedantic//g' -i Makefile ";
+  preBuild = ''
+    sed -e 's/-pedantic//g' -i Makefile
+    sed -e 's/iostream[.]h/iostream/' -i *.cpp
+    sed -e 's/iomanip[.]h/iomanip/' -i *.cpp
+    sed -e '1iusing namespace std;' -i *.cpp
+  '';
 
   preInstall = "echo -e 'install:\n	mkdir \${out}/bin;\n	cp xmacrorec xmacrorec2 xmacroplay \${out}/bin;' >>Makefile; ";
 
diff --git a/pkgs/tools/X11/xnee/default.nix b/pkgs/tools/X11/xnee/default.nix
index 7ecb5cd22b59..4ea21acac4c9 100644
--- a/pkgs/tools/X11/xnee/default.nix
+++ b/pkgs/tools/X11/xnee/default.nix
@@ -2,17 +2,17 @@
 , gtk, libXi, inputproto, pkgconfig, recordproto, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "xnee-3.09";
+  name = "xnee-3.10";
 
   src = fetchurl {
     url = "mirror://gnu/xnee/${name}.tar.gz";
-    sha256 = "08171scqiqzgmbq03rwjvlsakvw9cqrr7h3b743j14z4jzbasi8i";
+    sha256 = "0mkbp0gikm1mv9g2v0vs7krinkz392p1crvaira8ml9q94py0q32";
   };
 
   patchPhase =
     '' for i in `find cnee/test -name \*.sh`
        do
-         sed -i "$i" -e's|/bin/bash|/bin/sh|g'
+         sed -i "$i" -e's|/bin/bash|/bin/sh|g ; s|/usr/bin/env bash|/bin/sh|g'
        done
     '';
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     # Do a static build because `libxnee' doesn't get installed anyway.
-    [ "--disable-gnome-applet" "--disable-shared" "--enable-static" ];
+    [ "--disable-gnome-applet" "--enable-static" ];
 
   # `cnee' is linked without `-lXi' and as a consequence has a RUNPATH that
   # lacks libXi.
diff --git a/pkgs/tools/archivers/zip/builder.sh b/pkgs/tools/archivers/zip/builder.sh
deleted file mode 100644
index da58762b4342..000000000000
--- a/pkgs/tools/archivers/zip/builder.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-source $stdenv/setup
-
-buildFlags="-f unix/Makefile generic"
-
-installFlags="-f unix/Makefile prefix=$out INSTALL=cp"
-
-genericBuild
diff --git a/pkgs/tools/archivers/zip/default.nix b/pkgs/tools/archivers/zip/default.nix
index 9498bf089ff2..884af0f0b035 100644
--- a/pkgs/tools/archivers/zip/default.nix
+++ b/pkgs/tools/archivers/zip/default.nix
@@ -1,12 +1,19 @@
-{stdenv, fetchurl}: stdenv.mkDerivation {
-  name = "zip-2.32";
-  builder = ./builder.sh;
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "zip-3.0";
+
   src = fetchurl {
-    url = ftp://ftp.info-zip.org/pub/infozip/src/zip232.tgz;
-    md5 = "8a4da4460386e324debe97f3b7fe4d96";
+    url = ftp://ftp.info-zip.org/pub/infozip/src/zip30.tgz;
+    sha256 = "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h";
   };
 
+  buildFlags="-f unix/Makefile generic";
+
+  installFlags="-f unix/Makefile prefix=$(out) INSTALL=cp";
+
   meta = {
     homepage = http://www.info-zip.org;
   };
 }
+
diff --git a/pkgs/tools/backup/bacula/default.nix b/pkgs/tools/backup/bacula/default.nix
new file mode 100644
index 000000000000..c6ad08768231
--- /dev/null
+++ b/pkgs/tools/backup/bacula/default.nix
@@ -0,0 +1,20 @@
+{stdenv, fetchurl, sqlite, zlib, acl, ncurses, openssl, readline}:
+
+stdenv.mkDerivation {
+  name = "bacula-5.0.3";
+
+  src = fetchurl {
+    url = mirror://sourceforge/bacula/bacula-5.0.3.tar.gz;
+    sha256 = "1d7x6jw5x9ljbdxvcc8k635lsxcbxw9kzjyxf6l4zsdv3275j1cr";
+  };
+
+  buildInputs = [ sqlite zlib acl ncurses openssl readline ];
+
+  configureFlags = [ "--with-sqlite3=${sqlite}" ];
+
+  meta = {
+    description = "Enterprise ready, Network Backup Tool";
+    homepage = http://bacula.org/;
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/tools/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix
new file mode 100644
index 000000000000..e08ea1e03f4b
--- /dev/null
+++ b/pkgs/tools/backup/bup/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, python, unzip, perl }:
+
+stdenv.mkDerivation {
+  name = "bup-0.24b";
+  src = fetchurl {
+    url = "https://github.com/apenwarr/bup/zipball/bup-0.24b";
+    sha256 = "0l50i8mrg43ahd8fn1n6pwa0xslxr07pvkh0r4qyywv55172ip8v";
+    name = "bup-0.24b.zip";
+  };
+  buildInputs = [ unzip python perl ];
+  patchPhase = ''
+    for f in cmd/* lib/tornado/* lib/tornado/test/* t/* wvtest.py main.py; do
+      substituteInPlace $f --replace "/usr/bin/env python" "${python}/bin/python"
+    done
+    substituteInPlace Makefile --replace "./format-subst.pl" "perl ./format-subst.pl"
+    substituteInPlace lib/bup/csetup.py --replace "'bupsplit.c'])" "'bupsplit.c'], library_dirs=['${python}/lib'])"
+  '';
+  makeFlags = "MANDIR=$(out)/man DOCDIR=$(out)/share/doc/bup BINDIR=$(out)/bin LIBDIR=$(out)/lib/bup";
+  meta = {
+    description = "Highly efficient file backup system based on the git packfile format. Capable of doing *fast* incremental backups of virtual machine images.";
+    homepage = "https://github.com/apenwarr/bup";
+  };
+}
diff --git a/pkgs/tools/cd-dvd/xorriso/default.nix b/pkgs/tools/cd-dvd/xorriso/default.nix
index e1ff13b4ffc6..1b489f9a5caf 100644
--- a/pkgs/tools/cd-dvd/xorriso/default.nix
+++ b/pkgs/tools/cd-dvd/xorriso/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, libcdio, zlib, bzip2, readline, acl }:
 
 stdenv.mkDerivation rec {
-  name = "xorriso-1.1.0.pl01";
+  name = "xorriso-1.1.4";
 
   src = fetchurl {
     url = "mirror://gnu/xorriso/${name}.tar.gz";
-    sha256 = "0718p8acgn46zms0672xlaxav1acj79wsy5yif6gai5s62zw18l9";
+    sha256 = "0zxmln5kw5prqrs8bahwz4lhvl914xphsjizlz3nr9y2l39350j8";
   };
 
   doCheck = true;
diff --git a/pkgs/tools/filesystems/dosfstools/default.nix b/pkgs/tools/filesystems/dosfstools/default.nix
index f5e51430af39..21e2ceea9dd8 100644
--- a/pkgs/tools/filesystems/dosfstools/default.nix
+++ b/pkgs/tools/filesystems/dosfstools/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "dosfstools-3.0.9";
+  name = "dosfstools-3.0.11";
 
   src = fetchurl {
     url = "http://www.daniel-baumann.ch/software/dosfstools/${name}.tar.bz2";
-    sha256 = "13s5s0hvhmn7r4ppqmw8nqgdm5v5vc6r5j44kn87wl5cmrpnfqrz";
+    sha256 = "1a6rzjy82f6579ywaln33g1wc7k8gbgjdss9q2q8daplac7pmcll";
   };
 
   makeFlags = "PREFIX=$(out)";
diff --git a/pkgs/tools/filesystems/encfs/default.nix b/pkgs/tools/filesystems/encfs/default.nix
index c950810026a8..9ebab38984bc 100644
--- a/pkgs/tools/filesystems/encfs/default.nix
+++ b/pkgs/tools/filesystems/encfs/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, fuse, boost, rlog }:
 
 stdenv.mkDerivation {
-  name = "encfs-1.6.1";
+  name = "encfs-1.7.4";
 
   src = fetchurl {
-    url = "http://encfs.googlecode.com/files/encfs-1.6-1.tgz";
-    sha256 = "0k50ic5nyibb9giif9dqm6sj20q0yzri3drg78m788z17xp060mw";
+    url = "http://encfs.googlecode.com/files/encfs-1.7.4.tgz";
+    sha256 = "1a3h47f4h0qdc0bf3vic1i8wrdw5nkx22mml4wsvmmrd9zqg0bi8";
   };
 
   buildInputs = [ boost fuse openssl rlog ];
diff --git a/pkgs/tools/filesystems/sshfs-fuse/default.nix b/pkgs/tools/filesystems/sshfs-fuse/default.nix
index 92e7d854fd88..606914cd976e 100644
--- a/pkgs/tools/filesystems/sshfs-fuse/default.nix
+++ b/pkgs/tools/filesystems/sshfs-fuse/default.nix
@@ -9,6 +9,10 @@ stdenv.mkDerivation rec {
   };
   
   buildInputs = [ pkgconfig glib fuse ];
+  postInstall = ''
+    ensureDir $out/sbin
+    ln -sf $out/bin/sshfs $out/sbin/mount.sshfs
+  '';
 
   meta = {
     homepage = http://fuse.sourceforge.net/sshfs.html;
diff --git a/pkgs/tools/filesystems/xtreemfs/default.nix b/pkgs/tools/filesystems/xtreemfs/default.nix
new file mode 100644
index 000000000000..98657891f2d6
--- /dev/null
+++ b/pkgs/tools/filesystems/xtreemfs/default.nix
@@ -0,0 +1,79 @@
+x@{builderDefsPackage
+  , boost, fuse, openssl, cmake, attr, jdk, ant, which, python, file
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="XtreemFS";
+    version="1.3.0";
+    name="${baseName}-${version}";
+    url="http://xtreemfs.googlecode.com/files/${name}.tar.gz";
+    hash="15rg3dh22kb2g94fmbb6r32a9qfl3yr4ql17rwj50l4y8wrcx0hf";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["setVars" "fixMakefile" "doMakeInstall" "fixInterpreterBin"
+    "fixInterpreterEtc"
+    "usrIsOut"];
+
+  setVars = a.noDepEntry ''
+    export JAVA_HOME="${jdk}"
+    export ANT_HOME="${ant}"
+    export CMAKE_HOME=${cmake}
+  '';
+
+  fixMakefile = a.fullDepEntry ''
+    sed -e 's@DESTDIR)/usr@DESTDIR)@g' -i Makefile
+
+    sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/configure
+    sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/gtest/configure
+    sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/gtest-*/configure
+  '' ["doUnpack" "minInit"];
+
+  fixInterpreterBin = a.doPatchShebangs "$out/bin";
+  fixInterpreterEtc = a.doPatchShebangs "$out/etc/xos/xtreemfs";
+
+  usrIsOut = a.fullDepEntry ''
+    sed -e "s@/usr/@$out/@g" -i \
+      "$out"/{bin/xtfs_*,etc/xos/xtreemfs/*.*,etc/xos/xtreemfs/*/*,etc/init.d/*}
+    sed -e "s@JAVA_HOME=/usr@JAVA_HOME=${jdk}@g" -i \
+      "$out"/{bin/xtfs_*,etc/init.d/*}
+  '' ["minInit"];
+
+  makeFlags = [
+    ''DESTDIR="$out"''
+    ''SHELL="${a.stdenv.shell}"''
+  ];
+      
+  meta = {
+    description = "A distributed filesystem";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.bsd3;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://xtreemfs.org/download_sources.php";
+    };
+  };
+}) x
+
diff --git a/pkgs/tools/misc/aws-mturk-clt/default.nix b/pkgs/tools/misc/aws-mturk-clt/default.nix
new file mode 100644
index 000000000000..f2fe1d959303
--- /dev/null
+++ b/pkgs/tools/misc/aws-mturk-clt/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, jre }:
+
+stdenv.mkDerivation rec {
+  name = "aws-mturk-clt-1.3.0";
+  
+  src = fetchurl {
+    url = "http://mturk.s3.amazonaws.com/CLTSource/${name}.tar.gz";
+    sha256 = "06p0cbb5afmqjjlibbw9gb08jp270c7j57lhnf9ld50sm1z021ln";
+  };
+
+  installPhase =
+    ''
+      mkdir -p $out
+      cp -prvd bin $out/
+
+      for i in $out/bin/*.sh; do
+        sed -i "$i" -e "s|^MTURK_CMD_HOME=.*|MTURK_CMD_HOME=$out\nexport JAVA_HOME=${jre}|"
+      done
+
+      mkdir -p $out/lib
+      cp -prvd lib/* $out/lib/
+    ''; # */
+
+  meta = {
+    homepage = https://requester.mturk.com/developer;
+    description = "Command line tools for interacting with the Amazon Mechanical Turk";
+    license = "unfree-redistributable";
+
+    longDescription =
+      ''
+        The Amazon Mechanical Turk is a crowdsourcing marketplace that
+        allows users (“requesters”) to submit tasks to be performed by
+        other humans (“workers”) for a small fee.  This package
+        contains command-line tools for submitting tasks, querying
+        results, and so on.
+
+        The command-line tools expect a file
+        <filename>mturk.properties<filename> in the current directory,
+        which should contain the following:
+
+        <screen>
+        access_key=[insert your access key here]
+        secret_key=[insert your secret key here]
+        service_url=http://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester
+        </screen>
+      '';
+  };
+}
diff --git a/pkgs/tools/misc/fdupes/default.nix b/pkgs/tools/misc/fdupes/default.nix
index 868ea6e4b5d6..04a0662a3b6e 100644
--- a/pkgs/tools/misc/fdupes/default.nix
+++ b/pkgs/tools/misc/fdupes/default.nix
@@ -1,16 +1,16 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "fdupes-1.40";
+  name = "fdupes-1.50-PR2";
   src = fetchurl {
-    url = http://premium.caribe.net/~adrian2/programs/fdupes-1.40.tar.gz;
-    sha256 = "1ryxpckgrmqa4y7nx9a9xpg4z1r00k11kc1cm7lqv87l9g293vg1";
+    url = http://fdupes.googlecode.com/files/fdupes-1.50-PR2.tar.gz;
+    sha256 = "068nxcn3xilaphq53sywli9ndydy4gijfi2mz7h45kpy0q9cgwjs";
   };
 
-  installPhase =  ''
-    mkdir -p $out/{bin,man/man1}
-    make INSTALLDIR=$out/bin MANPAGEDIR=$out/man install
-  '';
+  # workaround: otherwise make install fails (should be fixed in trunk)
+  preInstall = "ensureDir $out/bin $out/man/man1";
+
+  makeFlags = "PREFIX=\${out}";
 
   meta = {
     description = "identifies duplicate files residing within specified directories.";
@@ -18,7 +18,11 @@ stdenv.mkDerivation {
       FDUPES uses md5sums and then a byte by byte comparison to finde duplicate
       files within a set of directories.
     '';
-    homepage = http://premium.caribe.net/~adrian2/fdupes.html;
+    homepage = http://code.google.com/p/fdupes/;
     license = "MIT";
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [
+      stdenv.lib.maintainers.z77z
+    ];
   };
 }
diff --git a/pkgs/tools/misc/heimdall/default.nix b/pkgs/tools/misc/heimdall/default.nix
new file mode 100644
index 000000000000..0b0120ab2791
--- /dev/null
+++ b/pkgs/tools/misc/heimdall/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchgit, pkgconfig, libusb1, udev
+, enableGUI ? true, qt4 ? null
+}:
+
+stdenv.mkDerivation {
+  name = "heimdall-1.3.0";
+
+  src = fetchgit {
+    url = git://github.com/Benjamin-Dobell/Heimdall.git;
+    rev = "ed9b08e5d9e3db60d52bccf6cb6919fb4bd47602";
+    sha256 = "e65f18299a05699595548cb27393a01b4e1dbbced82d4add8d0d55ef6514a691";
+  };
+
+  buildInputs =
+    [ pkgconfig libusb1 udev ]
+    ++ stdenv.lib.optional enableGUI qt4 ;
+
+  makeFlags = "udevrulesdir=$(out)/lib/udev/rules.d";
+  
+  preConfigure =
+    ''
+      pushd libpit
+      ./configure
+      make
+      popd
+    
+      cd heimdall
+      substituteInPlace Makefile.in --replace sudo true
+
+      # Give ownership of the Galaxy S USB device to the logged in
+      # user.
+      substituteInPlace 60-heimdall-galaxy-s.rules --replace 'MODE="0666"' 'TAG+="udev-acl"'
+    '';
+
+  postBuild = stdenv.lib.optionalString enableGUI
+    ''
+      pushd ../heimdall-frontend
+      substituteInPlace Source/mainwindow.cpp --replace /usr/bin $out/bin
+      qmake heimdall-frontend.pro OUTPUTDIR=$out/bin
+      make
+      popd
+    '';
+
+  postInstall =
+    ''
+      mkdir -p $out/share/doc/heimdall
+      cp ../Linux/README $out/share/doc/heimdall/
+    '' + stdenv.lib.optionalString enableGUI ''
+      make -C ../heimdall-frontend install
+    '';
+
+  meta = {
+    homepage = http://www.glassechidna.com.au/products/heimdall/;
+    description = "A cross-platform open-source tool suite used to flash firmware onto Samsung Galaxy S devices";
+    license = "bsd";
+  };
+}
diff --git a/pkgs/tools/misc/mc/default.nix b/pkgs/tools/misc/mc/default.nix
index 4a76adfd6216..d3ea7a38a74b 100644
--- a/pkgs/tools/misc/mc/default.nix
+++ b/pkgs/tools/misc/mc/default.nix
@@ -1,66 +1,20 @@
-{ stdenv, fetchurl, lib, pkgconfig, glib, ncurses, e2fsprogs, gpm
-, libX11, libXt, shebangfix, perl, zip, unzip, gettext, slang}:
+{ stdenv, fetchurl, pkgconfig, glib, gpm, file, e2fsprogs
+, libX11, libICE, perl, zip, unzip, gettext, slang}:
 
 stdenv.mkDerivation rec {
-  name = "mc-4.6.1";
+  name = "mc-4.7.5.3";
+  
   src = fetchurl {
-    url = "http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/${name}.tar.gz";
-    sha256 = "0zly25mwdn84s0wqx9mzyqi177mm828716nv1n6a4a5cm8yv0sh8";
+    url = http://www.midnight-commander.org/downloads/mc-4.7.5.3.tar.bz2;
+    sha256 = "1di8fsdg6y98iq3846j145qjk4bf5rgjj2hxnxdbcwfp8p3v8x88";
   };
-  buildInputs = [pkgconfig glib ncurses libX11 libXt
-                 shebangfix perl zip unzip slang gettext e2fsprogs gpm];
-  
-  # Fix the paths to the terminfo files. Otherwise mc has no colors
-  preConfigure = ''
-    sed -i -e "s|/usr/lib/terminfo|${ncurses}/lib/terminfo|" configure
-  '';
-  configureFlags = "--enable-charset";
-  
-  # Stole some patches from LFS which fix some nasty bugs
-  patches = [ ./mc-4.6.1-bash32-1.patch ./mc-4.6.1-debian_fixes-1.patch ];
   
-  # Required to enable the Debian UTF8 fixes
-  CPPFLAGS = "-DUTF8";
-  
-  # The Debian UTF8 patch expects that the documentation is in UTF8 format,
-  # therefore we have to convert them (I stole this also from LFS)
-  
-  postBuildPhase = ''
-    for file in lib/mc.hint{,.es,.it,.nl} doc/{es,it}/mc.hlp.*
-    do
-        iconv -f ISO-8859-1 -t UTF-8 $file > $file.utf8 &&
-        mv $file.utf8 $file
-    done &&
-    for file in lib/mc.hint{.cs,.hu,.pl} doc/{hu,pl}/mc.hlp.*
-    do
-        iconv -f ISO-8859-2 -t UTF-8 $file > $file.utf8 &&
-        mv $file.utf8 $file
-    done &&
-    for file in lib/mc.hint.sr doc/sr/mc.hlp.sr
-    do
-        iconv -f ISO-8859-5 -t UTF-8 $file > $file.utf8 &&
-        mv $file.utf8 $file
-    done &&
-    for file in doc/ru/mc.hlp.ru lib/mc.hint.ru
-    do
-        iconv -f KOI8-R -t UTF-8 $file > $file.utf8 &&
-        mv $file.utf8 $file
-    done &&
+  buildInputs = [ pkgconfig perl glib gpm slang zip unzip file gettext libX11 libICE e2fsprogs ];
 
-    iconv -f KOI8-U -t UTF-8 lib/mc.hint.uk > lib/mc.hint.uk.utf8 &&
-    mv lib/mc.hint.uk.utf8 lib/mc.hint.uk &&
-    iconv -f BIG5 -t UTF-8 lib/mc.hint.zh > lib/mc.hint.zh.utf8 &&
-    mv lib/mc.hint.zh.utf8 lib/mc.hint.zh
-    # foo
-  '';
-  
-  makeFlags = "UNZIP=unzip";
-  postInstall = ''
-    find $out -iname "*.pl" | xargs shebangfix;
-  '';
   meta = {
     description = "File Manager and User Shell for the GNU Project";
-    homepage = http://www.ibiblio.org/mc;
-    maintainers = [ lib.maintainers.sander ];
+    homepage = http://www.midnight-commander.org;
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.sander ];
   };
 }
diff --git a/pkgs/tools/misc/parallel/default.nix b/pkgs/tools/misc/parallel/default.nix
index 2ddbc9620823..f9a35b235fc9 100644
--- a/pkgs/tools/misc/parallel/default.nix
+++ b/pkgs/tools/misc/parallel/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, perl }:
 
 stdenv.mkDerivation rec {
-  name = "parallel-20110622";
+  name = "parallel-20110822";
 
   src = fetchurl {
     url = "mirror://gnu/parallel/${name}.tar.bz2";
-    sha256 = "1fy2csbkcd4hiivsx6qn5hppqazyff5n83c5c8s5dzbnkj0lmczr";
+    sha256 = "0ryj97b9w2mzvmnqhkh384s59v62gf0vlyj8qphiy34505x5pznb";
   };
 
   patchPhase =
diff --git a/pkgs/tools/misc/partition-manager/default.nix b/pkgs/tools/misc/partition-manager/default.nix
index b45b1a0aa1fb..46be78965fbd 100644
--- a/pkgs/tools/misc/partition-manager/default.nix
+++ b/pkgs/tools/misc/partition-manager/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, gettext, parted, libuuid, qt4, kdelibs, kdebase,
+{ stdenv, fetchurl, cmake, gettext, parted, libuuid, qt4, kdelibs, kde_baseapps,
   automoc4, phonon, perl }:
 
 stdenv.mkDerivation {
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs =
-    [ cmake gettext parted libuuid qt4 kdelibs kdebase automoc4 perl phonon ];
+    [ cmake gettext parted libuuid qt4 kdelibs kde_baseapps automoc4 perl phonon ];
 
   preConfigure = ''
     export VERBOSE=1
diff --git a/pkgs/tools/misc/system-config-printer/default.nix b/pkgs/tools/misc/system-config-printer/default.nix
index 998737660242..a7a08f291872 100644
--- a/pkgs/tools/misc/system-config-printer/default.nix
+++ b/pkgs/tools/misc/system-config-printer/default.nix
@@ -1,27 +1,40 @@
-{stdenv, fetchurl, udev, intltool, python, pkgconfig, glib, xmlto,
-  makeWrapper, pygobject, pygtk, docbook_xml_dtd_412, docbook_xsl,
-  pythonDBus, libxml2, desktop_file_utils, libusb, cups, pycups,
-  notify }:
+{ stdenv, fetchurl, udev, intltool, pkgconfig, glib, xmlto
+, makeWrapper, pygobject, pygtk, docbook_xml_dtd_412, docbook_xsl
+, pythonDBus, libxml2, desktop_file_utils, libusb, cups, pycups
+, xz, pythonPackages
+, withGUI ? true
+}:
 
 stdenv.mkDerivation rec {
   name = "${meta.name}-${meta.version}";
 
   src = fetchurl {
-    url = "http://cyberelk.net/tim/data/${meta.name}/1.2/${name}.tar.bz2";
-    sha256 = "16xjvahmdkkix7281gx7ac9zqaxgfb7pjjlgcc6kmw52cifk86ww";
+    url = "http://cyberelk.net/tim/data/${meta.name}/1.3/${name}.tar.xz";
+    sha256 = "1d50rqgpyrzyrxwq3qhafzq9075qm2wxdrh1f1q7whlr0chxi3mw";
   };
-  buildInputs = [ udev intltool python pkgconfig glib xmlto docbook_xml_dtd_412
-    libxml2 docbook_xsl desktop_file_utils libusb cups makeWrapper pygobject
-    pygtk pythonDBus pycups notify ];
 
+  buildInputs =
+    [ xz intltool pkgconfig glib udev libusb cups xmlto
+      libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
+      pythonPackages.python pythonPackages.wrapPython
+    ];
+
+  pythonPath =
+    [ pythonDBus pycups pygobject ]
+    ++ stdenv.lib.optionals withGUI [ pygtk pythonPackages.notify ];
+    
   configureFlags = "--with-udev-rules";
 
-  postInstall = ''
-    wrapProgram $out/bin/system-config-printer --set PYTHONPATH "$PYTHONPATH:$(toPythonPath $out):$(toPythonPath ${notify})/gtk-2.0"
-  '';
+  postInstall =
+    ''
+      wrapPythonPrograms
+      ( cd $out/share/system-config-printer/troubleshoot
+        mv .__init__.py-wrapped __init__.py
+      )
+    '';
 
   meta = {
     name = "system-config-printer";
-    version = "1.2.4";
+    version = "1.3.4";
   };
 }
diff --git a/pkgs/tools/networking/atftp/default.nix b/pkgs/tools/networking/atftp/default.nix
new file mode 100644
index 000000000000..2136762e6e0d
--- /dev/null
+++ b/pkgs/tools/networking/atftp/default.nix
@@ -0,0 +1,55 @@
+x@{builderDefsPackage
+  , readline, tcp_wrappers, pcre
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="atftp";
+    version="0.7";
+    name="${baseName}-${version}";
+    url="mirror://debian/pool/main/a/atftp/atftp_${version}.dfsg.orig.tar.gz";
+    hash="0nd5dl14d6z5abgcbxcn41rfn3syza6s57bbgh4aq3r9cxdmz08q";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doPatch" "doConfigure" "doMakeInstall"];
+      
+  debianPatch = a.fetchurl {
+    url = http://patch-tracker.debian.org/patch/nondebian/dl/atftp/0.7.dfsg-10;
+    sha256 = "0vannjp0wxvk10xxlr3hirgf0g57n9dr4vhmsyfd8x4cwgxwfgsa";
+  };
+
+  patches = [debianPatch];
+
+  meta = {
+    description = "Advanced tftp tools";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.gpl2Plus;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://packages.debian.org/source/sid/atftp";
+    };
+  };
+}) x
+
diff --git a/pkgs/tools/networking/isync/default.nix b/pkgs/tools/networking/isync/default.nix
index 03abdbcca626..aca9b47195d3 100644
--- a/pkgs/tools/networking/isync/default.nix
+++ b/pkgs/tools/networking/isync/default.nix
@@ -8,6 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1xmgzypl5a3i0fz1ca55vfbs5mv2l9icwf2gk8rvlbwrkn2wid68";
   };
 
+  patches = [ ./isync-recursice-imap.patch ]; # usefull patch to enable subfolders listing
   buildInputs = [ openssl pkgconfig db4 ];
 
   meta = {
diff --git a/pkgs/tools/networking/isync/isync-recursice-imap.patch b/pkgs/tools/networking/isync/isync-recursice-imap.patch
new file mode 100644
index 000000000000..db12069950fd
--- /dev/null
+++ b/pkgs/tools/networking/isync/isync-recursice-imap.patch
@@ -0,0 +1,114 @@
+diff -rupN ../isync-1.0.4_original/./src/drv_imap.c ./src/drv_imap.c
+--- ../isync-1.0.4_original/./src/drv_imap.c	2007-09-22 01:44:12.000000000 -0700
++++ ./src/drv_imap.c	2009-04-22 15:28:58.000000000 -0700
+@@ -1678,7 +1678,7 @@ imap_list( store_t *gctx, string_list_t 
+ 	int ret;
+ 
+ 	imap->boxes = 0;
+-	if ((ret = imap_exec_b( ctx, 0, "LIST \"\" \"%s%%\"", ctx->prefix )) != DRV_OK)
++	if ((ret = imap_exec_b( ctx, 0, "LIST \"\" \"%s*\"", ctx->prefix )) != DRV_OK)
+ 		return ret;
+ 	*retb = imap->boxes;
+ 	return DRV_OK;
+diff -rupN ../isync-1.0.4_original/./src/drv_maildir.c ./src/drv_maildir.c
+--- ../isync-1.0.4_original/./src/drv_maildir.c	2008-02-23 01:02:21.000000000 -0800
++++ ./src/drv_maildir.c	2009-04-22 15:34:05.000000000 -0700
+@@ -24,6 +24,7 @@
+ 
+ #include "isync.h"
+ 
++#include <assert.h>
+ #include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -46,6 +47,56 @@
+ #include <db.h>
+ #endif /* USE_DB */
+ 
++static void encode_maildir_box(const char* in, char* out, size_t size)
++{
++	const char* p;
++	char c;
++	size_t out_chars;
++
++	for (p = in, out_chars = 0; (c = *p); ++p, ++out, ++out_chars) {
++		assert(out_chars < size);
++		if (c == '/') {
++			assert(out_chars < size - 1);
++			*(out++) = '~';
++			*out = '-';
++			++out_chars;
++		}
++		else if (c == '~') {
++			assert(out_chars < size - 1);
++			*(out++) = '~';
++			*out = '~';
++			++out_chars;
++		}
++		else {
++			*out = c;
++		}
++	}
++	assert(out_chars < size);
++	*out = 0;
++}
++
++static void decode_maildir_box(const char* in, char* out, size_t size)
++{
++	const char* p;
++	char c;
++	size_t out_chars;
++
++	for (p = in, out_chars = 0; (c = *p); ++p, ++out, ++out_chars) {
++		assert(out_chars < size);
++		if (c == '~') {
++			assert(out_chars < size - 1);
++			c = *(++p);
++			*out = (c == '-' ? '/' : '~');
++			++out_chars;
++		}
++		else {
++			*out = c;
++		}
++	}
++	assert(out_chars < size);
++	*out = 0;
++}
++
+ typedef struct maildir_store_conf {
+ 	store_conf_t gen;
+ 	char *inbox;
+@@ -164,14 +215,17 @@ maildir_list( store_t *gctx, string_list
+ 		const char *inbox = ((maildir_store_conf_t *)gctx->conf)->inbox;
+ 		int bl;
+ 		struct stat st;
+-		char buf[PATH_MAX];
++ 		char buf[PATH_MAX], box[PATH_MAX];
+ 
+ 		if (*de->d_name == '.')
+ 			continue;
+ 		bl = nfsnprintf( buf, sizeof(buf), "%s%s/cur", gctx->conf->path, de->d_name );
+ 		if (stat( buf, &st ) || !S_ISDIR(st.st_mode))
+ 			continue;
+-		add_string_list( retb, !memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : de->d_name );
++ 
++ 		decode_maildir_box(de->d_name, box, PATH_MAX);
++  		add_string_list( retb,
++ 		                 !memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : box );
+ 	}
+ 	closedir (dir);
+ 
+@@ -717,8 +771,11 @@ maildir_prepare( store_t *gctx, int opts
+ #endif /* USE_DB */
+ 	if (!strcmp( gctx->name, "INBOX" ))
+ 		gctx->path = nfstrdup( ((maildir_store_conf_t *)gctx->conf)->inbox );
+-	else
+-		nfasprintf( &gctx->path, "%s%s", gctx->conf->path, gctx->name );
++ 	else {
++ 		char box[_POSIX_PATH_MAX];
++ 		encode_maildir_box(gctx->name, box, _POSIX_PATH_MAX);
++ 		nfasprintf( &gctx->path, "%s%s", gctx->conf->path, box );
++ 	}
+ 	if (opts & OPEN_SETFLAGS)
+ 		opts |= OPEN_OLD;
+ 	if (opts & OPEN_EXPUNGE)
diff --git a/pkgs/tools/networking/netboot/default.nix b/pkgs/tools/networking/netboot/default.nix
new file mode 100644
index 000000000000..a834ffc37396
--- /dev/null
+++ b/pkgs/tools/networking/netboot/default.nix
@@ -0,0 +1,60 @@
+x@{builderDefsPackage
+  , fetchgit, ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    ["fetchgit"];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    version="git-head-${rev}";
+    baseName="netboot";
+    rev="19a955cd87b399a5b56";
+    name="${baseName}-git-head";
+    url="git://github.com/ITikhonov/netboot.git";
+    hash="7610c734dc46183439c161d327e7ef6a3d5bc07b5173850b92f71ec047b109d6";
+  };
+in
+rec {
+  srcDrv = a.fetchgit {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+    rev = sourceInfo.rev;
+  };
+
+  src=srcDrv + "/";
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doBuild" "doDeploy"];
+
+  doBuild = a.fullDepEntry ''
+    gcc netboot.c -o netboot
+  '' ["doUnpack" "addInputs"];
+
+  doDeploy = a.fullDepEntry ''
+    ensureDir "$out/bin"
+    cp netboot "$out/bin"
+  '' ["defEnsureDir" "minInit"];
+      
+  meta = {
+    description = "Mini PXE server";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = "free-noncopyleft";
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "https://github.com/ITikhonov/netboot";
+    };
+  };
+}) x
+
diff --git a/pkgs/tools/networking/p2p/gtk-gnutella/builder.sh b/pkgs/tools/networking/p2p/gtk-gnutella/builder.sh
deleted file mode 100644
index 33dec4ff34d0..000000000000
--- a/pkgs/tools/networking/p2p/gtk-gnutella/builder.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-source $stdenv/setup
-
-configureScript="./Configure"
-
-dontAddPrefix=1
-
-configureFlags="-d -e -D prefix=$out -D gtkversion=2 -D official=true"
-
-genericBuild
\ No newline at end of file
diff --git a/pkgs/tools/networking/p2p/gtk-gnutella/default.nix b/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
index 239b76c940f9..e30192598ccd 100644
--- a/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
+++ b/pkgs/tools/networking/p2p/gtk-gnutella/default.nix
@@ -1,11 +1,29 @@
-{stdenv, fetchurl, pkgconfig, glib, gtk, libxml2}:
+{stdenv, fetchurl, pkgconfig, glib, gtk, libxml2, bison, gettext, zlib}:
 
+let
+  name = "gtk-gnutella";
+  version = "0.97";
+in
 stdenv.mkDerivation {
-  name = "gtk-gnutella-0.96.1";
-  builder = ./builder.sh;
+  name = "${name}-${version}";
+
   src = fetchurl {
-    url = mirror://sourceforge/gtk-gnutella/gtk-gnutella-0.96.1.tar.bz2;
-    md5 = "6529379cc105c1e98f501a67e8e875fd";
+    url = "mirror://sourceforge/${name}/${name}-${version}.tar.bz2";
+    sha256 = "0l2gdzp517hjk31318djq0sww6kzckzl9rfqvhgspihn874lm9hb";
+  };
+
+  buildInputs = [pkgconfig glib gtk libxml2 bison gettext zlib];
+
+  NIX_LDFLAGS = "-rpath ${zlib}/lib";
+  configureScript = "./Configure";
+  dontAddPrefix = true;
+  configureFlags = "-d -e -D prefix=$out -D gtkversion=2 -D official=true";
+
+  meta = {
+    homepage = "http://gtk-gnutella.sourceforge.net/";
+    description = "a server/client for Gnutella";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
-  buildInputs = [pkgconfig glib gtk libxml2];
 }
diff --git a/pkgs/tools/networking/pdsh/default.nix b/pkgs/tools/networking/pdsh/default.nix
index ed437d37b52b..07dfd5c30a71 100644
--- a/pkgs/tools/networking/pdsh/default.nix
+++ b/pkgs/tools/networking/pdsh/default.nix
@@ -1,10 +1,14 @@
 {stdenv, fetchurl, perl, readline, rsh, ssh, pam}:
 
+let
+  name = "pdsh-2.26";
+in
 stdenv.mkDerivation {
-  name = "pdsh-2.25";
+  inherit name;
+
   src = fetchurl {
-    url = "http://pdsh.googlecode.com/files/pdsh-2.25.tar.bz2";
-    sha256 = "00cigkpdmabvh2aqzw2qbs6i7yj5x4lg1196ap0k9gqdnw0fd70z";
+    url = "http://pdsh.googlecode.com/files/${name}.tar.bz2";
+    sha256 = "ada2f35509064bf9cd0fd5ca39a351108cdd6f5155b05f39f1711a271298469a";
   };
 
   buildInputs = [perl readline ssh pam];
@@ -18,21 +22,13 @@ stdenv.mkDerivation {
     configureFlagsArray=(
       "--infodir=$out/share/info"
       "--mandir=$out/share/man"
-      "--with-machines=$out/etc/machines"
+      "--with-machines=/etc/pdsh/machines"
       ${if readline == null then "--without-readline" else "--with-readline"}
       ${if ssh == null then "--without-ssh" else "--with-ssh"}
       ${if pam == null then "--without-pam" else "--with-pam"}
       ${if rsh == false then "--without-rsh" else "--with-rsh"}
       "--with-dshgroups"
       "--with-xcpu"
-      "--without-genders"
-      "--without-mqshell"
-      "--without-mrsh"
-      "--without-netgroup"
-      "--without-nodeattr"
-      "--without-nodeupdown"
-      "--without-qshell"
-      "--without-slurm"
       "--disable-debug"
     )
   '';
diff --git a/pkgs/tools/networking/s3cmd/default.nix b/pkgs/tools/networking/s3cmd/default.nix
new file mode 100644
index 000000000000..4b12ce4c5986
--- /dev/null
+++ b/pkgs/tools/networking/s3cmd/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+stdenv.mkDerivation rec {
+  name = "s3cmd-1.0.1";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/s3tools/${name}.tar.gz";
+    sha256 = "1kmxhilwix5plv3qb49as6jknll3pq5abw948h28jisskkm2cs6p";
+  };
+
+  buildInputs = [ pythonPackages.python pythonPackages.wrapPython ];
+
+  pythonPath = [ pythonPackages.ssl ];
+  
+  installPhase =
+    ''
+      python setup.py install --prefix=$out
+      wrapPythonPrograms
+    '';
+
+  meta = {
+    homepage = http://s3tools.org/;
+    description = "A command-line tool to manipulate Amazon S3 buckets";
+  };
+}
diff --git a/pkgs/tools/networking/tftp-hpa/default.nix b/pkgs/tools/networking/tftp-hpa/default.nix
new file mode 100644
index 000000000000..95420b48a301
--- /dev/null
+++ b/pkgs/tools/networking/tftp-hpa/default.nix
@@ -0,0 +1,48 @@
+x@{builderDefsPackage
+  , tcp_wrappers
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="tftp-hpa";
+    version="5.1";
+    name="${baseName}-${version}";
+    url="mirror://kernel/software/network/tftp/${name}.tar.bz2";
+    hash="0k72s0c7wm4fyb6lqfypdkcy6rimanr49slimx8p0di69w394gzx";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doConfigure" "doMakeInstall"];
+      
+  meta = {
+    description = "TFTP tools - a lot of fixes on top of BSD TFTP";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.bsd3;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://www.kernel.org/pub/software/network/tftp/";
+    };
+  };
+}) x
+
diff --git a/pkgs/tools/package-management/cabal-install/0.10.2.nix b/pkgs/tools/package-management/cabal-install/0.10.2.nix
index 8fa67946477a..e71c99cd0c37 100644
--- a/pkgs/tools/package-management/cabal-install/0.10.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.10.2.nix
@@ -1,13 +1,20 @@
-{cabal, HTTP, network, zlib} :
+{ cabal, HTTP, network, random, time, zlib }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "cabal-install";
-  name = self.fname;
-  version = "0.10.2"; # Haskell Platform 2011.2.0.0
+  version = "0.10.2";
   sha256 = "05gmgxdlymp66c87szx1vq6hlraispdh6pm0n85s74yihjwwhmv3";
-  extraBuildInputs = [HTTP network zlib];
-
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ HTTP network random time zlib ];
   meta = {
+    homepage = "http://www.haskell.org/cabal/";
     description = "The command-line interface for Cabal and Hackage";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.6.2.nix b/pkgs/tools/package-management/cabal-install/0.6.2.nix
index aafafab453de..83a2121a16be 100644
--- a/pkgs/tools/package-management/cabal-install/0.6.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.6.2.nix
@@ -1,13 +1,20 @@
-{cabal, HTTP, network, zlib} :
+{ cabal, HTTP, network, random, zlib }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "cabal-install";
-  name = self.fname;
-  version = "0.6.2"; # Haskell Platform 2009.0.0
+  version = "0.6.2";
   sha256 = "d8ea91bd0a2a624ab1cf52ddfe48cef02b532bb5e2fcda3fd72ca51efc04b41a";
-  extraBuildInputs = [HTTP network zlib];
-
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ HTTP network random zlib ];
   meta = {
+    homepage = "http://www.haskell.org/cabal/";
     description = "The command-line interface for Cabal and Hackage";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.8.0.nix b/pkgs/tools/package-management/cabal-install/0.8.0.nix
index 5e9f59f771ac..aa6369bb05cc 100644
--- a/pkgs/tools/package-management/cabal-install/0.8.0.nix
+++ b/pkgs/tools/package-management/cabal-install/0.8.0.nix
@@ -1,13 +1,20 @@
-{cabal, HTTP, network, zlib} :
+{ cabal, HTTP, network, random, time, zlib }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "cabal-install";
-  name = self.fname;
-  version = "0.8.0"; # Haskell Platform 2010.1.0.0
+  version = "0.8.0";
   sha256 = "6d16618ff454f8d732cad64a53b767b5b6bb95ba4970b260a40e8f467035493c";
-  extraBuildInputs = [HTTP network zlib];
-
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ HTTP network random time zlib ];
   meta = {
+    homepage = "http://www.haskell.org/cabal/";
     description = "The command-line interface for Cabal and Hackage";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.8.2.nix b/pkgs/tools/package-management/cabal-install/0.8.2.nix
index e739f806e6ce..c27b429afb4f 100644
--- a/pkgs/tools/package-management/cabal-install/0.8.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.8.2.nix
@@ -1,13 +1,20 @@
-{cabal, HTTP, network, zlib} :
+{ cabal, HTTP, network, random, time, zlib }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "cabal-install";
-  name = self.fname;
-  version = "0.8.2"; # Haskell Platform 2010.2.0.0
+  version = "0.8.2";
   sha256 = "8f896ab46ec6c578f620ce4150f7cd04a2088be793113b33cc570b13b6b86e0b";
-  extraBuildInputs = [HTTP network zlib];
-
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ HTTP network random time zlib ];
   meta = {
+    homepage = "http://www.haskell.org/cabal/";
     description = "The command-line interface for Cabal and Hackage";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index 5cdf879f3220..c89b913200b9 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.0pre27764";
+  name = "nix-1.0pre28391";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/1162354/download/4/${name}.tar.bz2";
-    sha256 = "fe8117644a67947dd8aa8594181ff893b09806ea7803c842cc0b5be86a31a9c6";
+    url = "http://hydra.nixos.org/build/1232663/download/4/${name}.tar.bz2";
+    sha256 = "c990f0ad564960b1d82fdbed32bee0db64c26b57400f027f01434237edd1be0f";
   };
 
   buildNativeInputs = [ perl pkgconfig ];
diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix
index 96a9ceacc836..3d759d733adb 100644
--- a/pkgs/tools/security/gnupg/default.nix
+++ b/pkgs/tools/security/gnupg/default.nix
@@ -13,11 +13,11 @@ assert useUsb -> (libusb != null);
 assert useCurl -> (curl != null);
 
 stdenv.mkDerivation rec {
-  name = "gnupg-2.0.17";
+  name = "gnupg-2.0.18";
 
   src = fetchurl {
     url = "mirror://gnupg/gnupg/${name}.tar.bz2";
-    sha256 = "19pf74hv26mis8wiq92ljlgmin6pv1m6qyf5h66wr5rgrdg9sr7a";
+    sha256 = "0nxf5nbgxi5splnw6xww5iy6sw367kz9x1cy5aaznhx45ivdvbj8";
   };
 
   buildInputs = [ readline zlib libgpgerror pth libgcrypt libassuan libksba ]
diff --git a/pkgs/tools/misc/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix
index b9866878b7a8..524a582fcb02 100644
--- a/pkgs/tools/misc/pinentry/default.nix
+++ b/pkgs/tools/security/pinentry/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   buildNativeInputs = [ pkgconfig ];
 
-  meta = { 
+  meta = {
     description = "GnuPG's interface to passphrase input";
 
     longDescription = ''
diff --git a/pkgs/tools/misc/pinentry/duplicate-glib-defs.patch b/pkgs/tools/security/pinentry/duplicate-glib-defs.patch
index 78796ee2f53a..78796ee2f53a 100644
--- a/pkgs/tools/misc/pinentry/duplicate-glib-defs.patch
+++ b/pkgs/tools/security/pinentry/duplicate-glib-defs.patch
diff --git a/pkgs/tools/misc/polkit-gnome/default.nix b/pkgs/tools/security/polkit-gnome/default.nix
index 9adab0fb0c27..9adab0fb0c27 100644
--- a/pkgs/tools/misc/polkit-gnome/default.nix
+++ b/pkgs/tools/security/polkit-gnome/default.nix
diff --git a/pkgs/tools/security/polkit-kde-agent/default.nix b/pkgs/tools/security/polkit-kde-agent/default.nix
new file mode 100644
index 000000000000..10836366b187
--- /dev/null
+++ b/pkgs/tools/security/polkit-kde-agent/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, kdelibs, polkit_qt_1, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "polkit-kde-agent-1-0.99.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/apps/KDE4.x/admin/${name}.tar.bz2";
+    sha256 = "0rxlq6x0vhvha8i6w109zpzzacp4imins55v4p4fq7a3k0kgywg3";
+  };
+
+  buildInputs = [ kdelibs polkit_qt_1 ];
+
+  buildNativeInputs = [ gettext ];
+
+  patchPhase = "sed -e s/KDE4_AUTOSTART/AUTOSTART/ -i CMakeLists.txt";
+
+  meta = {
+    platforms = stdenv.lib.platforms.linux;
+    description = "PolicyKit authentication agent for KDE";
+  };
+}
diff --git a/pkgs/tools/security/super/default.nix b/pkgs/tools/security/super/default.nix
new file mode 100644
index 000000000000..0d2e34a41253
--- /dev/null
+++ b/pkgs/tools/security/super/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "super-3.30.0";
+
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = "http://ftp.ucolick.org/pub/users/will/${name}-tar.gz";
+    sha256 = "1sxgixx1yg7h8g9799v79rk15gb39gn7p7fx032c078wxx38qwq4";
+  };
+
+  NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE";
+
+  configureFlags = "--sysconfdir=/etc --localstatedir=/var";
+
+  installFlags = "sysconfdir=$(out)/etc localstatedir=$(TMPDIR)";
+
+  meta = {
+    homepage = http://ftp.ucolick.org/pub/users/will/;
+    description = "Allows users to execute scripts as if they were root";
+    longDescription =
+      ''
+        This package provides two commands: 1) “super”, which allows
+        users to execute commands under a different uid/gid (specified
+        in /etc/super.tab); and 2) “setuid”, which allows root to
+        execute a command under a different uid.
+      '';
+  };  
+}
diff --git a/pkgs/tools/system/lxc/default.nix b/pkgs/tools/system/lxc/default.nix
index dbd1a6746f0a..3d9e0f740b5c 100644
--- a/pkgs/tools/system/lxc/default.nix
+++ b/pkgs/tools/system/lxc/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, libcap}:
 
 stdenv.mkDerivation rec{
-  name = "lxc-0.7.4";
+  name = "lxc-0.7.5";
 
   src = fetchurl {
-    url = "mirror://sourceforge/lxc/${name}.tar.gz";
-    sha256 = "a8237b2a42a05266a39aa9f9d64d7aa6f12b197cf1982d7764a0b0f9b940eef6";
+    url = "http://lxc.sf.net/download/lxc/${name}.tar.gz";
+    sha256 = "019ec63f250c874bf7625b1f1bf555b1a6e3a947937a4fca73100abddf829b1c";
   };
 
   patchPhase = ''
diff --git a/pkgs/tools/system/sg3_utils/default.nix b/pkgs/tools/system/sg3_utils/default.nix
index a87ba0d0a075..e2fa8eacc914 100644
--- a/pkgs/tools/system/sg3_utils/default.nix
+++ b/pkgs/tools/system/sg3_utils/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "sg3_utils-1.29";
+  name = "sg3_utils-1.31";
 
   src = fetchurl {
     url = "http://sg.danny.cz/sg/p/${name}.tgz";
-    sha256 = "0d1vlijp9y4n3c0sm0zzba38ad87b5v6nh3prgd8sfwvy79720fi";
+    sha256 = "190hhkhl096fxkspkr93lrq1n79xz5c5i2n4n4g998qc3yv3hjyq";
   };
 
   meta = {
diff --git a/pkgs/tools/system/sleuthkit/default.nix b/pkgs/tools/system/sleuthkit/default.nix
new file mode 100644
index 000000000000..86ec54ecb8fa
--- /dev/null
+++ b/pkgs/tools/system/sleuthkit/default.nix
@@ -0,0 +1,48 @@
+x@{builderDefsPackage
+  , libewf, afflib, openssl, zlib
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="sleuthkit";
+    version="3.2.2";
+    name="${baseName}-${version}";
+    url="mirror://sourceforge/project/${baseName}/${baseName}/${version}/${name}.tar.gz";
+    hash="02hik5xvbgh1dpisvc3wlhhq1aprnlsk0spbw6h5khpbq9wqnmgj";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doConfigure" "doMakeInstall"];
+      
+  meta = {
+    description = "A forensic/data recovery tool";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = "IBM Public License";
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://sourceforge.net/projects/sleuthkit/files/sleuthkit";
+    };
+  };
+}) x
+
diff --git a/pkgs/tools/misc/syslog-ng/default.nix b/pkgs/tools/system/syslog-ng/default.nix
index 584da1559b8e..f5ee2f1bcbba 100644
--- a/pkgs/tools/misc/syslog-ng/default.nix
+++ b/pkgs/tools/system/syslog-ng/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
     description = "Next-generation syslogd with advanced networking and filtering capabilities.";
     license = "GPLv2";
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/tools/system/tree/default.nix b/pkgs/tools/system/tree/default.nix
new file mode 100644
index 000000000000..549cc449f024
--- /dev/null
+++ b/pkgs/tools/system/tree/default.nix
@@ -0,0 +1,57 @@
+{stdenv, fetchurl}:
+
+let
+  version = "1.6.0";
+
+  # These settings are found in the Makefile, but there seems to be no
+  # way to select one ore the other setting other than editing the file
+  # manually, so we have to duplicate the know how here.
+  systemFlags =
+    if stdenv.isDarwin then ''
+      CFLAGS="-O2 -Wall -fomit-frame-pointer -no-cpp-precomp"
+      LDFLAGS=
+      EXTRA_OBJS=strverscmp.o
+    '' else if stdenv.isCygwin then ''
+      CFLAGS="-O2 -Wall -fomit-frame-pointer -DCYGWIN"
+      LDFLAGS=-s
+      TREE_DEST=tree.exe
+      EXTRA_OBJS=strverscmp.o
+    '' else if stdenv.isBSD then ''
+      CFLAGS="-O2 -Wall -fomit-frame-pointer"
+      LDFLAGS=-s
+      EXTRA_OBJS=strverscmp.o
+    '' else
+    ""; # use linux flags by default
+in
+stdenv.mkDerivation {
+  name = "tree-${version}";
+
+  src = fetchurl {
+    url = "http://mama.indstate.edu/users/ice/tree/src/tree-${version}.tgz";
+    sha256 = "4dc470a74880338b01da41701d8db90d0fb178877e526d385931a007d68d7591";
+  };
+
+  configurePhase = ''
+    sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |'
+    makeFlagsArray=(
+      prefix=$out
+      MANDIR=$out/share/man/man1
+      ${systemFlags}
+    )
+  '';
+
+  meta = {
+    homepage = "http://mama.indstate.edu/users/ice/tree/";
+    description = "command to produce a depth indented directory listing";
+    license = "GPLv2";
+
+    longDescription = ''
+      Tree is a recursive directory listing command that produces a
+      depth indented listing of files, which is colorized ala dircolors if
+      the LS_COLORS environment variable is set and output is to tty.
+    '';
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [stdenv.lib.maintainers.simons];
+  };
+}
diff --git a/pkgs/tools/text/dos2unix/default.nix b/pkgs/tools/text/dos2unix/default.nix
index 59fb08aad5f0..dcc4116813ba 100644
--- a/pkgs/tools/text/dos2unix/default.nix
+++ b/pkgs/tools/text/dos2unix/default.nix
@@ -1,41 +1,24 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, perl, gettext }:
 
 stdenv.mkDerivation {
-  name = "dos2unix-2.2";
+  name = "dos2unix-5.3.1";
   
   src = fetchurl {
-    url = http://cvs.fedoraproject.org/repo/pkgs/dos2unix/dos2unix-3.1.tar.bz2/f90026a397cf787083ec2e4892c6dcdd/dos2unix-3.1.tar.bz2;
-    md5 = "f90026a397cf787083ec2e4892c6dcdd";
+    url = http://waterlan.home.xs4all.nl/dos2unix/dos2unix-5.3.1.tar.gz;
+    sha256 = "0bwqw3wi0j4f1x8d39xw5v57ac0bc58j41vjx8v2qm1smg9jyci1";
   };
-  
-  patches = [
-    ./dos2unix-3.1.patch
-    ./dos2unix-3.1-segfault.patch
-    ./dos2unix-3.1-safeconv.patch
-    ./dos2unix-3.1-manpage-update-57507.patch
-    ./dos2unix-3.1-preserve-file-modes.patch
-    ./dos2unix-3.1-tmppath.patch
-    ./dos2unix-c-missing-arg.patch
-    ./dos2unix-missing-proto.patch
-    ./dos2unix-manpage.patch
-    ./dos2unix-preserve-file-modes.patch
-  ];
 
-  installPhase = ''
-    ensureDir $out/bin
-    ensureDir $out/share/man/man1
-    install -p -m755 dos2unix $out/bin
-    install  -p -m644 dos2unix.1 $out/share/man/man1
-    ln -s dos2unix $out/bin/mac2unix
+  configurePhase = ''
+    sed -i -e s,/usr,$out, Makefile
   '';
 
-  buildPhase = ''
-    rm -f dos2unix
-    make dos2unix
-  '';
+  buildInputs = [ perl gettext ];
 
   meta = {
-    homepage = http://unknown/;
-    description = "dos2unix tool";
+    homepage = http://waterlan.home.xs4all.nl/dos2unix.html;
+    description = "Tools to transform text files from dos to unix formats and vicervesa";
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; all;
   };
 }
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch
deleted file mode 100644
index e27096666f24..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-Patch by Bill Anderson, to fix bug:
-	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57507
-
-
-
-Description of Problem:
-
-The dos2unix man page examples are confusing.
-For instance, one piece of text mentions "c.txt", but that file
-isn't used in the following example.
-
-
-
---- dos2unix-3.1/dos2unix.1	2004-09-28 03:17:29.000000000 -0600
-+++ dos2unix-3.1/dos2unix.1-new	2004-09-28 03:16:32.000000000 -0600
-@@ -1,123 +1,126 @@
- .\" $$Id: dos2unix.1 2.2 1995/03/31 01:50:45 blin Exp blin $$
--.TH dos2unix 1 "dos2unix v3.0" "1995.03.31"
--
--.SH NAME
--
-+.\" 
-+.TH "dos2unix" "1" "dos2unix v3.0" "1995.03.31" ""
-+.SH "NAME"
- dos2unix \- DOS/MAC to UNIX text file format converter
- 
--.SH SYNOPSYS
--
--dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...]
--.PP
-+.SH "SYNOPSYS"
-+dos2unix [options] [\-c convmode] [\-o file ...] [\-n infile outfile ...]
-+.PP 
- Options:
--.PP
--[-hkqV] [--help] [--keepdate] [--quiet] [--version]
--
--.SH DESCRIPTION
-+.PP 
-+[\-hkqV] [\-\-help] [\-\-keepdate] [\-\-quiet] [\-\-version]
- 
--.PP
-+.SH "DESCRIPTION"
-+.PP 
- This manual page documents dos2unix, the program that converts plain text
- files in DOS/MAC format to UNIX format.
- 
--.SH OPTIONS
--
-+.SH "OPTIONS"
- The following options are available:
--.TP
--.B \-h --help
-+.TP 
-+.B \-h \-\-help
- Print online help.
- 
--.TP
--.B \-k --keepdate
-+.TP 
-+.B \-k \-\-keepdate
- Keep the date stamp of output file same as input file.
- 
--.TP
--.B \-q --quiet
-+.TP 
-+.B \-q \-\-quiet
- Quiet mode. Suppress all warning and messages.
- 
--.TP
--.B \-V --version
-+.TP 
-+.B \-V \-\-version
- Prints version information.
- 
--.TP
--.B \-c --convmode convmode
--Sets conversion mode. Simulates dos2unix under SunOS.
-+.TP 
-+.B \-c \-\-convmode convmode
-+Sets conversion mode. Where convmode is one of:
-+.B ASCII, 7bit, ISO, Mac
-+with ASCII being the default.
-+Simulates dos2unix under SunOS.
-+
-+
- 
--.TP
--.B \-o --oldfile file ...
-+.TP 
-+.B \-o \-\-oldfile file ...
- Old file mode. Convert the file and write output to it. The program 
- default to run in this mode. Wildcard names may be used.
- 
--.TP
--.B \-n --newfile infile outfile ...
-+.TP 
-+.B \-n \-\-newfile infile outfile ...
- New file mode. Convert the infile and write output to outfile. File names
- must be given in pairs and wildcard names should NOT be used or you WILL 
- lost your files. 
- 
--.SH EXAMPLES
--
--.LP
-+.SH "EXAMPLES"
-+.LP 
- Get input from stdin and write output to stdout.
--.IP
-+.IP 
- .B dos2unix
- 
--.LP
-+.LP 
- Convert and replace a.txt. Convert and replace b.txt.
--.IP
-+.IP 
- .B dos2unix a.txt b.txt
--.IP
--.B dos2unix -o a.txt b.txt
-+.IP 
-+.B dos2unix \-o a.txt b.txt
- 
--.LP
-+.LP 
- Convert and replace a.txt in ASCII conversion mode. 
-+.IP 
-+.B dos2unix a.txt \-c iso b.txt
-+
-+.LP 
- Convert and replace b.txt in ISO conversion mode.
-+.IP 
-+.B dos2unix \-c ascii a.txt \-c iso b.txt
-+
-+.LP 
- Convert c.txt from Mac to Unix ascii format.
--.IP
--.B dos2unix a.txt -c iso b.txt
--.IP
--.B dos2unix -c ascii a.txt -c iso b.txt
--.IP
--.B dos2unix -c mac a.txt  b.txt
- 
--.LP
-+.IP 
-+.B dos2unix \-c mac c.txt  b.txt
-+
-+.LP 
- Convert and replace a.txt while keeping original date stamp.
--.IP
--.B dos2unix -k a.txt
--.IP
--.B dos2unix -k -o a.txt
-+.IP 
-+.B dos2unix \-k a.txt
-+.IP 
-+.B dos2unix \-k \-o a.txt
- 
--.LP
-+.LP 
- Convert a.txt and write to e.txt.
--.IP
--.B dos2unix -n a.txt e.txt
-+.IP 
-+.B dos2unix \-n a.txt e.txt
- 
--.LP
-+.LP 
- Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt.
--.IP
--.B dos2unix -k -n a.txt e.txt 
-+.IP 
-+.B dos2unix \-k \-n a.txt e.txt 
- 
--.LP
-+.LP 
- Convert and replace a.txt. Convert b.txt and write to e.txt.
--.IP
--.B dos2unix a.txt -n b.txt e.txt
--.IP
--.B dos2unix -o a.txt -n b.txt e.txt
-+.IP 
-+.B dos2unix a.txt \-n b.txt e.txt
-+.IP 
-+.B dos2unix \-o a.txt \-n b.txt e.txt
- 
--.LP
-+.LP 
- Convert c.txt and write to e.txt. Convert and replace a.txt.
- Convert and replace b.txt. Convert d.txt and write to f.txt.
--.IP
--.B dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt
-+.IP 
-+.B dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt
- 
--.SH DIAGNOSTICS
--
--.SH BUGS
-+.SH "DIAGNOSTICS"
- 
-+.SH "BUGS"
- The program does not work properly under MSDOS in stdio processing mode. 
- If you know why is that so, please tell me.
- 
--.SH AUTHORS
--
--Benjamin Lin -
-+.SH "AUTHORS"
-+Benjamin Lin \-
- .B <blin@socs.uts.edu.au>
- 
- 
-@@ -125,18 +128,17 @@
- .B <wuebben@kde.org>
- 
- 
--.SH MISCELLANY
--
-+.SH "MISCELLANY"
- Tested environment:
--.IP
-+.IP 
- Linux 1.2.0 with GNU C 2.5.8
--.IP
-+.IP 
- SunOS 4.1.3 with GNU C 2.6.3
--.IP
--MS-DOS 6.20 with Borland C++ 4.02
--.PP
-+.IP 
-+MS\-DOS 6.20 with Borland C++ 4.02
-+.PP 
- Suggestions and bug reports are welcome.
- 
--.SH SEE ALSO
-+.SH "SEE ALSO"
- unix2dos(1) mac2unix(1)
- 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch
deleted file mode 100644
index 7e8f3bdd55d5..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- dos2unix-3.1/dos2unix.c.mode	2003-05-21 08:09:08.000000000 -0700
-+++ dos2unix-3.1/dos2unix.c	2003-05-21 08:09:56.000000000 -0700
-@@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  mode_t mode = S_IRUSR | S_IWUSR;
-   int fd;
- 
-   /* retrieve ipInFN file date stamp */
--  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-+  if (stat(ipInFN, &StatBuf))
-     RetVal = -1;
-+  else
-+    mode = StatBuf.st_mode;
- 
-   strcpy (TempPath, "./u2dtmpXXXXXX");
-   if((fd=mkstemp (TempPath))<0) {
-@@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN
- 	  RetVal = -1;
-   }
- 
-+  if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
-+    RetVal = -1;
-+
- #ifdef DEBUG
-   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
- #endif DEBUG
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch
deleted file mode 100644
index 11998be1fddf..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-* Fix http://bugzilla.redhat.com/57508 (make dos2unix not modify Mac
-  files unless in mac2unix mode)
-* Make mac2unix mode not create duplicate Unix line delimiters when
-  run on a DOS file. (mschwendt@users.sf.net)
-
-diff -Nur dos2unix-3.1-orig/dos2unix.c dos2unix-3.1/dos2unix.c
---- dos2unix-3.1-orig/dos2unix.c	1998-11-19 13:19:25.000000000 +0100
-+++ dos2unix-3.1/dos2unix.c	2004-09-26 20:57:41.606587616 +0200
-@@ -153,6 +153,24 @@
- }
- 
- 
-+void StripDelimiter(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, int CurChar)
-+{
-+  int TempNextChar;
-+  /* Don't modify Mac files when in dos2unix mode. */
-+  if ( (TempNextChar = getc(ipInF)) != EOF) {
-+    ungetc( TempNextChar, ipInF );  /* put back peek char */
-+    if ( TempNextChar != '\x0a' ) {
-+      putc( CurChar, ipOutF );  /* Mac line, put back CR */
-+    }
-+  }
-+  else if ( CurChar == '\x0d' ) {  /* EOF: last Mac line delimiter (CR)? */
-+    putc( CurChar, ipOutF );
-+  }
-+  if (ipFlag->NewLine) {  /* add additional LF? */
-+    putc('\n', ipOutF);
-+  }
-+}
-+
- /* converts stream ipInF to UNIX format text and write to stream ipOutF
-  * RetVal: 0  if success
-  *         -1  otherwise
-@@ -161,6 +179,7 @@
- {
-     int RetVal = 0;
-     int TempChar;
-+    int TempNextChar;
-     
-     if ( macmode )
-       ipFlag->ConvMode = 3;
-@@ -177,9 +196,7 @@
- 		break;
- 	      } 
- 	    } else {
--	      if (ipFlag->NewLine) {
--		putc('\n', ipOutF);
--	      }
-+	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
- 	    }
- 	  }
- 	  break;
-@@ -193,9 +210,7 @@
- 		break;
- 	      }
- 	    } else {
--	      if (ipFlag->NewLine) {
--		putc('\n', ipOutF);
--	      }
-+	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
- 	    }
- 	  }
- 	  break;
-@@ -209,9 +224,7 @@
- 		break;
- 	      }
- 	    } else {
--	      if (ipFlag->NewLine) {
--		putc('\n', ipOutF);
--	      }
-+	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
- 	    }
- 	  }
- 	  break;
-@@ -227,6 +240,13 @@
- 		}
- 	      }
- 	    else{
-+	      if ( (TempNextChar = getc(ipInF)) != EOF) {
-+		ungetc( TempNextChar, ipInF );  /* put back peek char */
-+		/* Don't touch this delimiter if it's a CR,LF pair. */
-+		if ( TempNextChar == '\x0a' ) {
-+		  continue;
-+		}
-+	      }
- 	      if (putc('\x0a', ipOutF) == EOF)
- 		{
- 		  RetVal = -1;
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch
deleted file mode 100644
index 7c8391bd2bdb..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch
+++ /dev/null
@@ -1,93 +0,0 @@
---- dos2unix-3.1/dos2unix.c.segf	Thu Jan 17 17:27:42 2002
-+++ dos2unix-3.1/dos2unix.c	Thu Jan 17 17:28:07 2002
-@@ -147,9 +147,9 @@
-  * RetVal: NULL if failure
-  *         file stream otherwise
-  */
--FILE* OpenOutFile(char *ipFN)
-+FILE* OpenOutFile(int fd)
- {
--  return (fopen(ipFN, W_CNTRL));
-+  return (fdopen(fd, W_CNTRL));
- }
- 
- 
-@@ -260,14 +260,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./d2utmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./d2utmpXXXXXX");
-+  if((fd=mkstemp (TempPath))<0) {
-+	  perror("Failed to open output temp file");
-+	  RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
-@@ -278,7 +281,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -295,6 +298,8 @@
-   /* can close out file? */
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
-+  if(fd>=0)
-+	  close(fd);
- 
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-@@ -340,14 +345,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./u2dtmpXXXXXX");
-+  if((fd=mkstemp (TempPath))<0) {
-+	  perror("Failed to open output temp file");
-+	  RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
-@@ -358,7 +366,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -376,6 +384,9 @@
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
- 
-+  if(fd>=0)
-+	  close(fd);
-+
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-     UTimeBuf.actime = StatBuf.st_atime;
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch
deleted file mode 100644
index 6db6c84e04a7..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch
+++ /dev/null
@@ -1,141 +0,0 @@
---- dos2unix-3.1/dos2unix.c.tmppath	2004-10-20 16:00:00.342561008 +0200
-+++ dos2unix-3.1/dos2unix.c	2004-10-20 16:01:42.210074792 +0200
-@@ -69,6 +69,7 @@
- #ifdef __MSDOS__
- #  include <dir.h>
- #endif __MSDOS__
-+#include <libgen.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -267,6 +268,39 @@
-     return RetVal;
- }
- 
-+static int MakeTempFileFrom(const char *OutFN, char **fname_ret)
-+{
-+  char *cpy = strdup(OutFN);
-+  char *dir = NULL;
-+  size_t fname_len = 0;
-+  char  *fname_str = NULL;
-+  int fd = -1;
-+  
-+  *fname_ret = NULL;
-+  
-+  if (!cpy)
-+    goto make_failed;
-+  
-+  dir = dirname(cpy);
-+  
-+  fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char);
-+  if (!(fname_str = malloc(fname_len)))
-+    goto make_failed;
-+  sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX");
-+  *fname_ret = fname_str;
-+  
-+  free(cpy);
-+  
-+  if ((fd = mkstemp(fname_str)) == -1)
-+    goto make_failed;
-+  
-+  return (fd);
-+  
-+ make_failed:
-+  free(*fname_ret);
-+  *fname_ret = NULL;
-+  return (-1);
-+}
- 
- /* convert file ipInFN to UNIX format text and write to file ipOutFN
-  * RetVal: 0 if success
-@@ -277,7 +311,7 @@
-   int RetVal = 0;
-   FILE *InF = NULL;
-   FILE *TempF = NULL;
--  char TempPath[16];
-+  char *TempPath;
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   int fd;
-@@ -286,8 +320,7 @@
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./d2utmpXXXXXX");
--  if((fd=mkstemp (TempPath))<0) {
-+  if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) {
- 	  perror("Failed to open output temp file");
- 	  RetVal = -1;
-   }
-@@ -304,6 +337,7 @@
-   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-+    InF = NULL;
-     RetVal = -1;
-   }
- 
-@@ -337,9 +371,6 @@
-   /* can rename temp file to out file? */
-   if (!RetVal)
-   {
--    if (stat(ipOutFN, &StatBuf) == 0)
--      unlink(ipOutFN);
--
-     if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet))
-     {
-       fprintf(stderr, "dos2unix: problems renaming '%s' to '%s'\n", TempPath, ipOutFN);
-@@ -347,6 +378,7 @@
-       RetVal = -1;
-     }
-   }
-+  free(TempPath);
-   return RetVal;
- }
- 
-@@ -362,7 +394,7 @@
-   int RetVal = 0;
-   FILE *InF = NULL;
-   FILE *TempF = NULL;
--  char TempPath[16];
-+  char *TempPath;
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   mode_t mode = S_IRUSR | S_IWUSR;
-@@ -374,8 +406,7 @@
-   else
-     mode = StatBuf.st_mode;
- 
--  strcpy (TempPath, "./u2dtmpXXXXXX");
--  if((fd=mkstemp (TempPath))<0) {
-+  if((fd = MakeTempFileFrom(ipInFN, &TempPath))<0) {
- 	  perror("Failed to open output temp file");
- 	  RetVal = -1;
-   }
-@@ -395,6 +426,7 @@
-   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-+    InF = NULL;
-     RetVal = -1;
-   }
- 
-@@ -422,10 +454,6 @@
-       RetVal = -1;
-   }
- 
--  /* can delete in file? */
--  if ((!RetVal) && (unlink(ipInFN) == -1))
--    RetVal = -1;
--
-   /* any error? */
-   if ((RetVal) && (unlink(TempPath)))
-     RetVal = -1;
-@@ -440,6 +468,7 @@
-     }
-     RetVal = -1;
-   }
-+  free(TempPath);
-   return RetVal;
- }
- 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1.patch
deleted file mode 100644
index 5f823b2e7a9b..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-3.1.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- dos2unix-3.1/Makefile.orig	Thu Nov 19 07:09:38 1998
-+++ dos2unix-3.1/Makefile	Fri Nov 17 13:25:35 2000
-@@ -1,10 +1,12 @@
-+CFLAGS=
-+
- default: dos2unix
- 
- all:	dos2unix link install
- 
- 
- dos2unix:
--	gcc -O dos2unix.c -o dos2unix
-+	gcc $(CFLAGS) dos2unix.c -o dos2unix
- 
- 
- link:	
-@@ -12,11 +14,10 @@
- 	ln -s dos2unix.1 mac2unix.1		
- 
- clean:
--	rm dos2unix
-+	rm -f dos2unix mac2unix mac2unix.1 *~ *.orig core
- 
- install:
- 	install -m 755 dos2unix /usr/local/bin
- 	install -m 644 dos2unix.1 /usr/local/man/man1
- 	install -m 755 mac2unix /usr/local/bin
- 	install -m 644 mac2unix.1 /usr/local/man/man1
--
---- dos2unix-3.1/dos2unix.c.orig	Thu Nov 19 07:19:25 1998
-+++ dos2unix-3.1/dos2unix.c	Fri Nov 17 13:25:25 2000
-@@ -267,7 +267,7 @@
- 
-   strcpy (TempPath, "./d2utmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
-@@ -347,7 +347,7 @@
- 
-   strcpy (TempPath, "./u2dtmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
diff --git a/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch b/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch
deleted file mode 100644
index ff63e67134f7..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -up dos2unix-3.1/dos2unix.c.c-missing-arg dos2unix-3.1/dos2unix.c
---- dos2unix-3.1/dos2unix.c.c-missing-arg	2008-01-18 09:24:21.000000000 +0000
-+++ dos2unix-3.1/dos2unix.c	2008-01-18 09:25:43.000000000 +0000
-@@ -533,19 +533,28 @@ int main (int argc, char *argv[])
-       
-       if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0))
-       {
--        ArgIdx++;
--        if (strcmpi(argv[ArgIdx],"ASCII") == 0)
--          pFlag->ConvMode = 0;
--        else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
--          pFlag->ConvMode = 1;
--        else if (strcmpi(argv[ArgIdx], "ISO") == 0)
--          pFlag->ConvMode = 2;
--        else if (strcmpi(argv[ArgIdx], "Mac") == 0)
--          pFlag->ConvMode = 3;
-+        if (++ArgIdx < argc)
-+        {
-+          if (strcmpi(argv[ArgIdx],"ASCII") == 0)
-+            pFlag->ConvMode = 0;
-+          else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
-+            pFlag->ConvMode = 1;
-+          else if (strcmpi(argv[ArgIdx], "ISO") == 0)
-+            pFlag->ConvMode = 2;
-+          else if (strcmpi(argv[ArgIdx], "Mac") == 0)
-+            pFlag->ConvMode = 3;
-+          else
-+          {
-+            if (!pFlag->Quiet)
-+              fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
-+            ShouldExit = 1;
-+          }
-+        }
-         else
-         {
-+          ArgIdx--;
-           if (!pFlag->Quiet)
--            fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
-+            fprintf(stderr,"dos2unix: option `%s' requires an argument\n",argv[ArgIdx]);
-           ShouldExit = 1;
-         }
-       }
diff --git a/pkgs/tools/text/dos2unix/dos2unix-manpage.patch b/pkgs/tools/text/dos2unix/dos2unix-manpage.patch
deleted file mode 100644
index f9e1e6701bc7..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-manpage.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up dos2unix-3.1/dos2unix.1.manpage dos2unix-3.1/dos2unix.1
---- dos2unix-3.1/dos2unix.1.manpage	2008-09-08 09:58:46.000000000 +0100
-+++ dos2unix-3.1/dos2unix.1	2008-09-08 09:58:56.000000000 +0100
-@@ -52,7 +52,7 @@ default to run in this mode. Wildcard na
- .B \-n \-\-newfile infile outfile ...
- New file mode. Convert the infile and write output to outfile. File names
- must be given in pairs and wildcard names should NOT be used or you WILL 
--lost your files. 
-+lose your files. 
- 
- .SH "EXAMPLES"
- .LP 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch b/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch
deleted file mode 100644
index 72cd2c0b6a45..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -up dos2unix-3.1/dos2unix.c.missing-proto dos2unix-3.1/dos2unix.c
---- dos2unix-3.1/dos2unix.c.missing-proto	2008-04-14 17:11:58.000000000 +0100
-+++ dos2unix-3.1/dos2unix.c	2008-04-14 17:12:42.000000000 +0100
-@@ -75,6 +75,11 @@ static int macmode = 0;
- #include <string.h>
- #include <utime.h>
- #include <sys/stat.h>
-+#if defined(__MSDOS__) || defined(__WIN32__) || defined(_WIN32)
-+#  include <io.h>
-+#else
-+#  include <unistd.h>
-+#endif
- #include "dos2unix.h"
- 
- 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch b/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
deleted file mode 100644
index 1d4ab5d8e71e..000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -up dos2unix-3.1/dos2unix.c.preserve-file-modes dos2unix-3.1/dos2unix.c
---- dos2unix-3.1/dos2unix.c.preserve-file-modes	2008-09-08 09:58:05.000000000 +0100
-+++ dos2unix-3.1/dos2unix.c	2008-09-08 10:16:04.000000000 +0100
-@@ -320,9 +320,10 @@ int ConvertDosToUnixNewFile(char *ipInFN
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   int fd;
-+  mode_t mask;
- 
-   /* retrieve ipInFN file date stamp */
--  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-+  if (stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
-   if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) {
-@@ -346,6 +347,12 @@ int ConvertDosToUnixNewFile(char *ipInFN
-     RetVal = -1;
-   }
- 
-+  /* preserve original mode as modified by umask */
-+  mask = umask(0);
-+  umask(mask);
-+  if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask))
-+    RetVal = -1;
-+
-   /* conversion sucessful? */
-   if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag)))
-     RetVal = -1;
diff --git a/pkgs/tools/text/kdiff3/default.nix b/pkgs/tools/text/kdiff3/default.nix
index 63956a630354..a474a036661b 100644
--- a/pkgs/tools/text/kdiff3/default.nix
+++ b/pkgs/tools/text/kdiff3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4, perl, kdelibs, kdebase, automoc4, phonon, gettext}:
+{ stdenv, fetchurl, cmake, qt4, perl, kdelibs, automoc4, phonon, gettext, kde_baseapps }:
 
 stdenv.mkDerivation rec {
   name = "kdiff3-0.9.95";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   };
 
   # kdebase allows having a konqueror plugin built
-  buildInputs = [ cmake qt4 perl kdelibs automoc4 phonon gettext kdebase ];
+  buildInputs = [ cmake qt4 perl kdelibs automoc4 phonon gettext kde_baseapps ];
 
   # Adjust the version of the DocBook XML to 4.2 ( so that it validates ).
   patches = [ ./adjust-docbook-xml-version-to-4.2.patch ];
diff --git a/pkgs/tools/text/mairix/default.nix b/pkgs/tools/text/mairix/default.nix
new file mode 100644
index 000000000000..feaf3afe52b4
--- /dev/null
+++ b/pkgs/tools/text/mairix/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, zlib, bzip2, bison, flex }:
+
+stdenv.mkDerivation rec {
+  name = "mairix-0.22";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mairix/${name}.tar.gz";
+    sha256 = "0kwxq738nbv8ip5gkq2bw320qs1vg0pnv7wsc0p5cxwzxxrv47ql";
+  };
+
+  buildInputs = [ zlib bzip2 bison flex ];
+
+  meta = {
+    homepage = http://www.rc0.org.uk/mairix;
+    license = "GPLv2+";
+    description = "Program for indexing and searching email messages stored in maildir, MH or mbox";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/tools/text/unix2dos/default.nix b/pkgs/tools/text/unix2dos/default.nix
deleted file mode 100644
index 326149feb210..000000000000
--- a/pkgs/tools/text/unix2dos/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "unix2dos-2.2";
-  
-  src = fetchurl {
-    url = http://cvs.fedoraproject.org/repo/pkgs/unix2dos/unix2dos-2.2.src.tar.gz/e4488c241fa9067a48a7534a21d4babb/unix2dos-2.2.src.tar.gz;
-    md5 = "e4488c241fa9067a48a7534a21d4babb";
-  };
-
-  patches = [
-    ./unix2dos-mkstemp.patch
-    ./unix2dos-2.2-segfault.patch
-    ./unix2dos-2.2-manpage.patch
-    ./unix2dos-2.2-mode.patch
-    ./unix2dos-2.2-tmppath.patch
-    ./unix2dos-preserve-file-modes.patch
-  ];
-
-  sourceRoot = ".";
-
-  buildPhase = ''
-    cc -o unix2dos unix2dos.c
-  '';
-
-  installPhase = ''
-    ensureDir $out/bin
-    ensureDir $out/share/man
-    install -p -m755 unix2dos $out/bin
-    install -p -m444 unix2dos.1 $out/share/man
-  '';
-
-  meta = {
-    homepage = http://unknown/;
-    description = "unix2dos tool";
-  };
-}
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch
deleted file mode 100644
index 1172e2f82ea7..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -up unix2dos-2.2/unix2dos.1.man unix2dos-2.2/unix2dos.1
---- unix2dos-2.2/unix2dos.1.man	1995-03-30 17:03:22.000000000 +0100
-+++ unix2dos-2.2/unix2dos.1	2008-09-08 09:49:19.000000000 +0100
-@@ -16,7 +16,7 @@ Options:
- .SH DESCRIPTION
- 
- .PP
--This manual page documents dos2unix, the program that converts text 
-+This manual page documents unix2dos, the program that converts text 
- files in UNIX format to DOS format.
- 
- .SH OPTIONS
-@@ -40,7 +40,7 @@ Prints version information.
- 
- .TP
- .B \-c --convmode convmode
--Sets conversion mode. Simulates dos2unix under SunOS.
-+Sets conversion mode. Simulates unix2dos under SunOS.
- 
- .TP
- .B \-o --oldfile file ...
-@@ -51,7 +51,7 @@ default to run in this mode. Wildcard na
- .B \-n --newfile infile outfile ...
- New file mode. Convert the infile and write output to outfile. File names
- must be given in pairs and wildcard names should NOT be used or you WILL 
--lost your files. 
-+lose your files. 
- 
- .SH EXAMPLES
- 
-@@ -71,9 +71,9 @@ Convert and replace a.txt. Convert and r
- Convert and replace a.txt in ASCII conversion mode.
- Convert and replace b.txt in ISO conversion mode.
- .IP
--.B dos2unix a.txt -c iso b.txt
-+.B unix2dos a.txt -c iso b.txt
- .IP
--.B dos2unix -c ascii a.txt -c iso b.txt
-+.B unix2dos -c ascii a.txt -c iso b.txt
- 
- .LP
- Convert and replace a.txt while keeping original date stamp.
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch
deleted file mode 100644
index f5ff62aab823..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -up unix2dos-2.2/unix2dos.c.mode unix2dos-2.2/unix2dos.c
---- unix2dos-2.2/unix2dos.c.mode	2008-09-08 10:13:39.000000000 +0100
-+++ unix2dos-2.2/unix2dos.c	2008-09-08 10:13:39.000000000 +0100
-@@ -292,11 +292,14 @@ int ConvertUnixToDosOldFile(char* ipInFN
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  mode_t mode = S_IRUSR | S_IWUSR;
-   int fd;
- 
-   /* retrieve ipInFN file date stamp */
--  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-+  if (stat(ipInFN, &StatBuf))
-     RetVal = -1;
-+  else
-+    mode = StatBuf.st_mode;
- 
-   strcpy (TempPath, "./u2dtmpXXXXXX");
-   if((fd=mkstemp (TempPath)) < 0) {
-@@ -304,6 +307,9 @@ int ConvertUnixToDosOldFile(char* ipInFN
-       RetVal = -1;
-   }
- 
-+  if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
-+    RetVal = -1;
-+
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
- #endif DEBUG    
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch
deleted file mode 100644
index a92f57cfe70c..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- unix2dos-2.2/unix2dos.c.segf	Thu Jan 17 17:09:49 2002
-+++ unix2dos-2.2/unix2dos.c	Thu Jan 17 17:12:47 2002
-@@ -131,9 +131,9 @@
-  * RetVal: NULL if failure
-  *         file stream otherwise
-  */
--FILE* OpenOutFile(char *ipFN)
-+FILE* OpenOutFile(int fd)
- {
--  return (fopen(ipFN, W_CNTRL));
-+  return (fdopen(fd, W_CNTRL));
- }
- 
- 
-@@ -207,14 +207,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./u2dtmpXXXXXX");
-+  if((fd=mkstemp (TempPath)) < 0) {
-+	  perror("Can't open output temp file");
-+	  RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -225,7 +228,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -243,6 +246,9 @@
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
- 
-+  if(fd>=0)
-+	  close(fd);
-+
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-     UTimeBuf.actime = StatBuf.st_atime;
-@@ -286,14 +292,17 @@
-   char TempPath[16];
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  int fd;
- 
-   /* retrieve ipInFN file date stamp */
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmp");
--  strcat (TempPath, "XXXXXX");
--  mkstemp (TempPath);
-+  strcpy (TempPath, "./u2dtmpXXXXXX");
-+  if((fd=mkstemp (TempPath)) < 0) {
-+      perror("Can't open output temp file");
-+      RetVal = -1;
-+  }
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -304,7 +313,7 @@
-     RetVal = -1;
- 
-   /* can open out file? */
--  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
-+  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-     RetVal = -1;
-@@ -322,6 +331,9 @@
-   if ((TempF) && (fclose(TempF) == EOF))
-     RetVal = -1;
- 
-+  if(fd>=0)
-+	  close(fd);
-+
-   if ((!RetVal) && (ipFlag->KeepDate))
-   {
-     UTimeBuf.actime = StatBuf.st_atime;
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch
deleted file mode 100644
index f8ad138f4da0..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-diff -up unix2dos-2.2/unix2dos.c.tmppath unix2dos-2.2/unix2dos.c
---- unix2dos-2.2/unix2dos.c.tmppath	2008-09-08 10:14:30.000000000 +0100
-+++ unix2dos-2.2/unix2dos.c	2008-09-08 10:14:30.000000000 +0100
-@@ -57,7 +57,10 @@
- 
- #ifdef __MSDOS__
- #  include <dir.h>
-+#else
-+#  include <unistd.h>
- #endif __MSDOS
-+#include <libgen.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -195,6 +198,40 @@ int ConvertUnixToDos(FILE* ipInF, FILE* 
- }
- 
- 
-+static int MakeTempFileFrom(const char *OutFN, char **fname_ret)
-+{
-+  char *cpy = strdup(OutFN);
-+  char *dir = NULL;
-+  size_t fname_len = 0;
-+  char  *fname_str = NULL;
-+  int fd = -1;
-+  
-+  *fname_ret = NULL;
-+ 
-+  if (!cpy)
-+    goto make_failed;
-+  
-+  dir = dirname(cpy);
-+  
-+  fname_len = strlen(dir) + strlen("/u2dtmpXXXXXX") + sizeof (char);
-+  if (!(fname_str = malloc(fname_len)))
-+    goto make_failed;
-+  sprintf(fname_str, "%s%s", dir, "/u2dtmpXXXXXX");
-+  *fname_ret = fname_str;
-+
-+  free(cpy);
-+
-+  if ((fd = mkstemp(fname_str)) == -1)
-+    goto make_failed;
-+  
-+  return (fd);
-+  
-+ make_failed:
-+  free(*fname_ret);
-+  *fname_ret = NULL;
-+  return (-1);
-+}
-+
- /* convert file ipInFN to DOS format text and write to file ipOutFN
-  * RetVal: 0 if success
-  *         -1 otherwise
-@@ -204,7 +241,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
-   int RetVal = 0;
-   FILE *InF = NULL;
-   FILE *TempF = NULL;
--  char TempPath[16];
-+  char *TempPath;
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   int fd;
-@@ -213,8 +250,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
-   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
--  strcpy (TempPath, "./u2dtmpXXXXXX");
--  if((fd=mkstemp (TempPath)) < 0) {
-+  if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) {
- 	  perror("Can't open output temp file");
- 	  RetVal = -1;
-   }
-@@ -231,6 +267,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
-   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-+    InF = NULL;
-     RetVal = -1;
-   }
- 
-@@ -265,9 +302,6 @@ int ConvertUnixToDosNewFile(char *ipInFN
-   /* can rename temp file to out file? */
-   if (!RetVal)
-   {
--    if (stat(ipOutFN, &StatBuf) == 0)
--      unlink(ipOutFN);
--
-     if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet))
-     {
-       fprintf(stderr, "unix2dos: problems renaming '%s' to '%s'\n", TempPath, ipOutFN);
-@@ -275,6 +309,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
-       RetVal = -1;
-     }
-   }
-+  free(TempPath);
- 
-   return RetVal;
- }
-@@ -289,7 +324,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
-   int RetVal = 0;
-   FILE *InF = NULL;
-   FILE *TempF = NULL;
--  char TempPath[16];
-+  char *TempPath;
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   mode_t mode = S_IRUSR | S_IWUSR;
-@@ -301,8 +336,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
-   else
-     mode = StatBuf.st_mode;
- 
--  strcpy (TempPath, "./u2dtmpXXXXXX");
--  if((fd=mkstemp (TempPath)) < 0) {
-+  if((fd = MakeTempFileFrom(ipInFN, &TempPath)) < 0) {
-       perror("Can't open output temp file");
-       RetVal = -1;
-   }
-@@ -322,6 +356,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
-   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
-   {
-     fclose (InF);
-+    InF = NULL;
-     RetVal = -1;
-   }
- 
-@@ -349,10 +384,6 @@ int ConvertUnixToDosOldFile(char* ipInFN
-       RetVal = -1;
-   }
- 
--  /* can delete in file? */
--  if ((!RetVal) && (unlink(ipInFN) == -1))
--    RetVal = -1;
--
-   /* any error? */
-   if ((RetVal) && (unlink(TempPath)))
-     RetVal = -1;
-@@ -367,6 +398,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
-     }
-     RetVal = -1;
-   }
-+  free(TempPath);
-   return RetVal;
- }
- 
diff --git a/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch b/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch
deleted file mode 100644
index 034e0a00b686..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- unix2dos-2.2/unix2dos.c.orig	Fri Nov 17 13:29:24 2000
-+++ unix2dos-2.2/unix2dos.c	Fri Nov 17 13:30:16 2000
-@@ -214,7 +214,7 @@
- 
-   strcpy (TempPath, "./u2dtmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
-@@ -293,7 +293,7 @@
- 
-   strcpy (TempPath, "./u2dtmp");
-   strcat (TempPath, "XXXXXX");
--  mktemp (TempPath);
-+  mkstemp (TempPath);
- 
- #ifdef DEBUG
-   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
diff --git a/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch b/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch
deleted file mode 100644
index e824044b50c6..000000000000
--- a/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -up unix2dos-2.2/unix2dos.c~ unix2dos-2.2/unix2dos.c
---- unix2dos-2.2/unix2dos.c~	2008-03-03 13:16:34.000000000 +0000
-+++ unix2dos-2.2/unix2dos.c	2008-03-03 13:22:10.000000000 +0000
-@@ -244,10 +244,11 @@ int ConvertUnixToDosNewFile(char *ipInFN
-   char *TempPath;
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-+  mode_t mask;
-   int fd;
- 
-   /* retrieve ipInFN file date stamp */
--  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-+  if (stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
-   if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) {
-@@ -271,6 +272,12 @@ int ConvertUnixToDosNewFile(char *ipInFN
-     RetVal = -1;
-   }
- 
-+  /* preserve original mode as modified by umask */
-+  mask = umask(0);
-+  umask(mask);
-+  if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask))
-+      RetVal = -1;
-+
-   /* conversion sucessful? */
-   if ((!RetVal) && (ConvertUnixToDos(InF, TempF, ipFlag)))
-     RetVal = -1;
diff --git a/pkgs/tools/typesetting/lhs2tex/default.nix b/pkgs/tools/typesetting/lhs2tex/default.nix
index 68f2347bb656..61e1dfb9d875 100644
--- a/pkgs/tools/typesetting/lhs2tex/default.nix
+++ b/pkgs/tools/typesetting/lhs2tex/default.nix
@@ -1,6 +1,6 @@
 {cabal, texLive, regexCompat}:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "lhs2tex";
   version = "1.17";
   name = self.fname;
@@ -14,9 +14,14 @@ cabal.mkDerivation (self : {
   '';
 
   meta = {
+    homepage = "http://www.andres-loeh.de/lhs2tex/";
     description = "Preprocessor for typesetting Haskell sources with LaTeX";
-    license = "GPLv2";
-    maintainers = [self.stdenv.lib.maintainers.andres];
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
 
diff --git a/pkgs/tools/video/dvgrab/default.nix b/pkgs/tools/video/dvgrab/default.nix
new file mode 100644
index 000000000000..de2964a798f9
--- /dev/null
+++ b/pkgs/tools/video/dvgrab/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv, libunwind, libraw1394, libjpeg, libiec61883, libdv
+, libavc1394, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "dvgrab-3.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/kino/${name}.tar.gz";
+    sha256 = "1y8arv14nc9sf8njfcxf96pb4nyimpsly1fnhcbj406k54s1h42r";
+  };
+
+  buildInputs =
+    [ libunwind libraw1394 libjpeg libiec61883 libdv libavc1394
+      pkgconfig
+    ];
+
+  meta = {
+    description = "dvgrab, receive and store audio & video over IEEE1394";
+
+    longDescription =
+      '' dvgrab receives audio and video data from a digital camcorder via an
+         IEEE1394 (widely known as FireWire) or USB link and stores them into
+         one of several file formats. It features autosplit of long video
+         sequences, and supports saving the data as raw frames, AVI type 1,
+         AVI type 2, Quicktime DV, a series of JPEG stills or MPEG2-TS.
+      '';
+
+    homepage = http://kinodv.org/;
+
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.gnu;
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
diff --git a/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix b/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix
index 622b26f0b356..d0ab00057f5a 100644
--- a/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix
+++ b/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
   
   src = fetchurl {
     url = http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip;
-    sha256 = "0wsgd656wiwn0maqanz6c61jdwaz0gva8wx25x312xnsl8k0gy94";
+    sha256 = "310e3b405c11b979b1cd210c5b4c32e97065d616f6bfa449c4e1e50420ce8002";
   };
 
   # Amazon EC2 requires that disk images are writable.  If they're
diff --git a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
index 0160b1bbe192..7f856b8165de 100644
--- a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
+++ b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation {
   
   src = fetchurl {
     url = http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip;
-    sha256 = "0qv3dy6zx5yxix3g90agj39k35sry3cifhzlhprv35lapiynsd0j";
+    sha256 = "e4dea0fb23b7e17bfe794b80f83bef47f290e2c9296105a80a7aecf7d33ecaf2";
   };
 
   buildInputs = [ unzip makeWrapper ];