summary refs log tree commit diff
path: root/pkgs/tools/system/foremost
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/foremost')
-rw-r--r--pkgs/tools/system/foremost/default.nix39
-rw-r--r--pkgs/tools/system/foremost/makefile.patch23
2 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/tools/system/foremost/default.nix b/pkgs/tools/system/foremost/default.nix
new file mode 100644
index 00000000000..baaa97b4b24
--- /dev/null
+++ b/pkgs/tools/system/foremost/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl }:
+
+let version = "1.5.7"; in
+stdenv.mkDerivation rec {
+  name = "foremost-${version}";
+
+  src = fetchurl {
+    sha256 = "0d2zxw0ijg8cd3ksgm8cf8jg128zr5x7z779jar90g9f47pm882h";
+    url = "http://foremost.sourceforge.net/pkg/${name}.tar.gz";
+  };
+
+  meta = with stdenv.lib; {
+    inherit version;
+    description = "Recover files based on their contents";
+    longDescription = ''
+      Foremost is a console program to recover files based on their headers,
+      footers, and internal data structures. Foremost can work on image files, such
+      as those generated by dd, Safeback, Encase, etc, or directly on a drive.
+      The headers and footers can be specified by a configuration file or you can
+      use command line switches to specify built-in file types. These built-in types
+      look at the data structures of a given file format allowing for a more
+      reliable and faster recovery.
+    '';
+    homepage = http://foremost.sourceforge.net/;
+    license = with licenses; publicDomain;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ nckx ];
+  };
+
+  patches = [ ./makefile.patch ];
+
+  makeFlags = "PREFIX=$(out)";
+
+  enableParallelBuilding = true;
+
+  preInstall = ''
+    mkdir -p $out/{bin,share/man/man8}
+  '';
+}
diff --git a/pkgs/tools/system/foremost/makefile.patch b/pkgs/tools/system/foremost/makefile.patch
new file mode 100644
index 00000000000..6626c9520ec
--- /dev/null
+++ b/pkgs/tools/system/foremost/makefile.patch
@@ -0,0 +1,23 @@
+--- a/Makefile	2015-04-21 00:40:46.949266581 +0200
++++ b/Makefile	2015-04-21 00:41:38.637165883 +0200
+@@ -24,9 +24,9 @@
+ RAW_FLAGS += -DVERSION=\"$(VERSION)\"
+ 
+ # Where we get installed
+-BIN = /usr/local/bin
+-MAN = /usr/share/man/man8
+-CONF= /usr/local/etc
++BIN = $(PREFIX)/bin
++MAN = $(PREFIX)/share/man/man8
++CONF= $(PREFIX)/etc
+ # Setup for compiling and cross-compiling for Windows
+ # The CR_ prefix refers to cross compiling from OSX to Windows
+ CR_CC = $(CR_BASE)/gcc
+@@ -120,7 +120,6 @@
+ install: goals
+ 	install -m 755 $(NAME) $(BIN)
+ 	install -m 444 $(MAN_PAGES) $(MAN)
+-	install -m 444 foremost.conf $(CONF)
+ macinstall: BIN = /usr/local/bin/
+ macinstall: MAN = /usr/share/man/man1/
+ macinstall: CONF = /usr/local/etc/