nixpkgs/pkgs/tools/backup/rsnapshot/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

{ fetchurl, stdenv, writeText, perl, openssh, rsync, logger,
configFile ? "/etc/rsnapshot.conf" }:
let patch = writeText "rsnapshot-config.patch" ''
--- rsnapshot-program.pl 2013-10-05 20:31:08.715991442 +0200
+++ rsnapshot-program.pl 2013-10-05 20:31:42.496193633 +0200
@@ -383,7 +383,7 @@
}
# set global variable
- $config_file = $default_config_file;
+ $config_file = '${configFile}';
}
# accepts no args
'';
in
stdenv.mkDerivation rec {
2013-10-05 22:07:52 +01:00
name = "rsnapshot-1.3.1";
src = fetchurl {
url = "mirror://sourceforge/rsnapshot/${name}.tar.gz";
2013-10-05 22:07:52 +01:00
sha256 = "0pn7vlg3yxl7xrvfwmp4zlrg3cckmlldq6qr5bs3b2b281zcgdll";
};
propagatedBuildInputs = [perl openssh rsync logger];
patchPhase = ''
substituteInPlace "Makefile.in" --replace \
"/usr/bin/pod2man" "${perl}/bin/pod2man"
patch -p0 <${patch}
'';
2014-10-01 21:24:27 +01:00
meta = with stdenv.lib; {
description = "A filesystem snapshot utility for making backups of local and remote systems";
homepage = http://rsnapshot.org/;
license = stdenv.lib.licenses.gpl2Plus;
2014-10-01 21:24:27 +01:00
platforms = platforms.linux;
};
}