btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / dd / ddrescue / package.nix
blob2e90558d3863370da60c4c8e3bdd6c5b1759051d
1 { lib, stdenv
2 , fetchurl, lzip
3 }:
5 stdenv.mkDerivation rec {
6   pname = "ddrescue";
7   version = "1.28";
9   src = fetchurl {
10     url = "mirror://gnu/ddrescue/ddrescue-${version}.tar.lz";
11     sha256 = "sha256-ZibAenyhzB0DytCVhSLFJ5sVYiLTLDQugRF8/vrrEME=";
12   };
14   nativeBuildInputs = [ lzip ];
16   doCheck = true; # not cross;
17   configureFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ];
19   meta = with lib; {
20     description = "GNU ddrescue, a data recovery tool";
22     longDescription = ''
23       GNU ddrescue is a data recovery tool.  It copies data from one file
24       or block device (hard disc, cdrom, etc) to another, trying hard to
25       rescue data in case of read errors.
27       The basic operation of ddrescue is fully automatic.  That is, you
28       don't have to wait for an error, stop the program, read the log, run
29       it in reverse mode, etc.
31       If you use the logfile feature of ddrescue, the data is rescued very
32       efficiently (only the needed blocks are read).  Also you can
33       interrupt the rescue at any time and resume it later at the same
34       point.
36       Automatic merging of backups: If you have two or more damaged copies
37       of a file, cdrom, etc, and run ddrescue on all of them, one at a
38       time, with the same output file, you will probably obtain a complete
39       and error-free file.  This is so because the probability of having
40       damaged areas at the same places on different input files is very
41       low.  Using the logfile, only the needed blocks are read from the
42       second and successive copies.
43     '';
45     homepage = "https://www.gnu.org/software/ddrescue/ddrescue.html";
47     license = licenses.gpl3Plus;
49     platforms = platforms.all;
50     maintainers = with maintainers; [ domenkozar fpletz ];
51   };