summary refs log tree commit diff
path: root/pkgs/tools/system/bootchart/default.nix
blob: ef0a6d251a39f88cea591036d09ca58615f6b6cd (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
{stdenv, fetchurl, gnutar, gzip, coreutils, utillinux, gnugrep, gnused, psmisc, nettools}:

stdenv.mkDerivation rec {
  name = "bootchart-0.9";

  src = fetchurl {
    url = "mirror://sourceforge/bootchart/${name}.tar.bz2";
    sha256 = "0z9jvi7cyp3hpx6hf1fyaa8fhnaz7aqid8wrkwp29cngryg3jf3p";
  };

  buildInputs = [ gnutar gzip coreutils utillinux gnugrep gnused psmisc nettools ];

  patchPhase = ''
    export MYPATH=
    for i in $buildInputs; do
       export MYPATH=''${MYPATH}''${MYPATH:+:}$i/bin:$i/sbin
    done

    sed -i -e 's,PATH.*,PATH='$MYPATH, \
       -e 's,^CONF.*,CONF='$out/etc/bootchartd.conf, \
      script/bootchartd
  '';

  installPhase = ''
    mkdir -p $out/sbin $out/etc
    cp script/bootchartd $out/sbin
    cp script/bootchartd.conf $out/etc
    chmod +x $out/sbin/bootchartd
  '';

  meta = with stdenv.lib; {
    homepage = http://www.bootchart.org/;
    description = "Performance analysis and visualization of the GNU/Linux boot process";
    license = licenses.gpl2Plus;
  };

}