summary refs log tree commit diff
path: root/pkgs/development/perl-modules/maatkit/default.nix
blob: d560a5d8e4104d9d841d5b27602fe801dd9a80c9 (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
{buildPerlPackage, stdenv, fetchurl, DBDmysql}:

buildPerlPackage rec {
  name = "maatkit-4790";

  src = fetchurl {
    url = "http://maatkit.googlecode.com/files/${name}.tar.gz" ;
    sha256 = "0lf6dgh1w96m234hrkhagyyvv1m1ldchpzsg6iswvkj6sbvv7d7h";
  };

  buildInputs = [ DBDmysql ] ;

  preConfigure = ''
    find . | while read fn; do
        if test -f "$fn"; then
            first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
            if test "$first" = "#!"; then
                sed < "$fn" > "$fn".tmp \
                    -e "s|^#\!\(.*[/\ ]perl.*\)$|#\!$perl/bin/perl $perlFlags|"
                if test -x "$fn"; then chmod +x "$fn".tmp; fi
                mv "$fn".tmp "$fn"
            fi
        fi
    done
  '' ;

  meta = {
    description = "Maatkit makes MySQL easier and safer to manage. It provides simple, predictable ways to do things you cannot otherwise do.";
    license = "GPLv2+";
    homepage = http://www.maatkit.org/;
  };
}