lol
1{ fetchFromGitHub, stdenv, writeText, perl, openssh, rsync, logger,
2 configFile ? "/etc/rsnapshot.conf" }:
3
4let patch = writeText "rsnapshot-config.patch" ''
5--- rsnapshot-program.pl 2013-10-05 20:31:08.715991442 +0200
6+++ rsnapshot-program.pl 2013-10-05 20:31:42.496193633 +0200
7@@ -383,7 +383,7 @@
8 }
9
10 # set global variable
11- $config_file = $default_config_file;
12+ $config_file = '${configFile}';
13 }
14
15 # accepts no args
16'';
17in
18stdenv.mkDerivation rec {
19 name = "rsnapshot-1.4git";
20 src = fetchFromGitHub {
21 owner = "DrHyde";
22 repo = "rsnapshot";
23 rev = "1047cbb57937c29233388e2fcd847fecd3babe74";
24 sha256 = "173y9q89dp4zf7nysqhjp3i2m086n7qdpawb9vx0ml5zha6mxf2p";
25 };
26
27 propagatedBuildInputs = [perl openssh rsync logger];
28
29 patchPhase = ''
30 substituteInPlace "Makefile.in" --replace \
31 "/usr/bin/pod2man" "${perl}/bin/pod2man"
32 patch -p0 <${patch}
33 '';
34
35 # I still think this is a good idea, but it currently fails in the chroot because it checks
36 # that things are writable and so on.
37 #checkPhase = ''
38 # if [ -f "${configFile}" ]
39 # then
40 # ${perl}/bin/perl -w ./rsnapshot configtest
41 # else
42 # echo File "${configFile}" does not exist, not checking
43 # fi
44 #'';
45
46 meta = with stdenv.lib; {
47 description = "A filesystem snapshot utility for making backups of local and remote systems";
48 homepage = http://rsnapshot.org/;
49 license = stdenv.lib.licenses.gpl2Plus;
50 platforms = platforms.linux;
51 };
52}