rsnapshot: configurable configuration file path

default value: /etc/rsnapshot.conf
This commit is contained in:
Aristid Breitkreuz 2013-10-05 19:40:47 +02:00
parent 38a20082cd
commit 80924c8f3c

View File

@ -1,5 +1,20 @@
{fetchurl, stdenv, perl, openssh, rsync, logger}:
{ 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 {
name = "rsnapshot-1.3.0";
src = fetchurl {
@ -12,6 +27,7 @@ stdenv.mkDerivation rec {
patchPhase = ''
substituteInPlace "Makefile.in" --replace \
"/usr/bin/pod2man" "${perl}/bin/pod2man"
patch -p0 <${patch}
'';
meta = {