about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/backup/mylvmbackup/default.nix
blob: ad1fcf6969446917e91d816088614eab1eb98f77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, stdenv
, fetchurl
, perlPackages
, makeWrapper
}:

stdenv.mkDerivation rec {
  pname = "mylvmbackup";
  version = "0.16";

  src = fetchurl {
    url = "https://www.lenzg.net/mylvmbackup/${pname}-${version}.tar.gz";
    sha256 = "sha256-vb7M3EPIrxIz6jUwm241fzaEz2czqdCObrFgSOSgJRU=";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ perlPackages.perl ];

  dontConfigure = true;

  postPatch = ''
    patchShebangs mylvmbackup
    substituteInPlace Makefile \
      --replace "prefix = /usr/local" "prefix = ${builtins.placeholder "out"}" \
      --replace "sysconfdir = /etc" "sysconfdir = ${builtins.placeholder "out"}/etc" \
      --replace "/usr/bin/install" "install"
  '';

  postInstall = ''
    wrapProgram "$out/bin/mylvmbackup" \
      --prefix PERL5LIB : "${perlPackages.makePerlPath (
    with perlPackages; [
      ConfigIniFiles
      DBDmysql
      DBI
      TimeDate
      FileCopyRecursive
    ]
  )}"
  '';

  meta = {
    homepage = "https://www.lenzg.net/mylvmbackup/";
    description = "a tool for quickly creating full physical backups of a MySQL server's data files";
    mainProgram = "mylvmbackup";
    license = lib.licenses.gpl2Only;
    maintainers = with lib.maintainers; [ ryantm ];
    platforms = with lib.platforms; linux;
  };
}