summary refs log tree commit diff
path: root/pkgs/tools/backup/dirvish
diff options
context:
space:
mode:
authorPatrick Winter <patrick.winter@adfinis-sygroup.ch>2018-12-03 16:55:32 +0100
committerPatrick Winter <patrick.winter@adfinis-sygroup.ch>2019-02-10 16:19:33 +0100
commit9cf5079ec34296ccc72c3d804ef78b4ce749bcbb (patch)
tree16d72c2f7043cffaaf8d8fb517e04daf3490ebbe /pkgs/tools/backup/dirvish
parent76b3cd665ff7628bb307c99a74dd0cd3ce4c4c94 (diff)
downloadnixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar.gz
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar.bz2
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar.lz
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar.xz
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.tar.zst
nixpkgs-9cf5079ec34296ccc72c3d804ef78b4ce749bcbb.zip
dirvish: init at 1.2.1
Diffstat (limited to 'pkgs/tools/backup/dirvish')
-rw-r--r--pkgs/tools/backup/dirvish/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/tools/backup/dirvish/default.nix b/pkgs/tools/backup/dirvish/default.nix
new file mode 100644
index 00000000000..ee5eee893f4
--- /dev/null
+++ b/pkgs/tools/backup/dirvish/default.nix
@@ -0,0 +1,61 @@
+{ fetchurl, stdenv, makeWrapper, perl, rsync, perlPackages }:
+
+stdenv.mkDerivation rec {
+  name = "dirvish-1.2.1";
+  src = fetchurl {
+    url = "http://dirvish.org/${name}.tgz";
+    sha256 = "6b7f29c3541448db3d317607bda3eb9bac9fb3c51f970611ffe27e9d63507dcd";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perl ] ++ (with perlPackages; [ GetoptLong TimeParseDate TimePeriod ]);
+
+  executables = [ "dirvish" "dirvish-runall" "dirvish-expire" "dirvish-locate" ];
+  manpages = [ "dirvish.8" "dirvish-runall.8" "dirvish-expire.8" "dirvish-locate.8" "dirvish.conf.5" ];
+
+  buildPhase = ''
+    HEADER="#!${perl}/bin/perl
+
+    \$CONFDIR = \"/etc/dirvish\";
+
+    "
+
+    for executable in $executables; do
+      (
+        echo "$HEADER"
+        cat $executable.pl loadconfig.pl
+      ) > $executable
+      chmod +x $executable
+    done
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp --target-directory=$out/bin $executables
+
+    for manpage in $manpages; do
+      if [[ $manpage =~ \.([[:digit:]]+)$ ]]; then
+        section=''${BASH_REMATCH[1]}
+        mkdir -p $out/man/man$section
+        cp --target-directory=$out/man/man$section $manpage
+      else
+        echo "Couldn't determine man page section by filename"
+        exit 1
+      fi
+    done
+  '';
+
+  postFixup = ''
+    for executable in $executables; do
+      wrapProgram $out/bin/$executable \
+        --set PERL5LIB "$PERL5LIB"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Dirvish is a fast, disk based, rotating network backup system";
+    homepage = http://dirvish.org/;
+    license = stdenv.lib.licenses.osl2;
+    platforms = platforms.linux;
+  };
+}