summary refs log tree commit diff
path: root/pkgs/tools/system/runit/default.nix
blob: 28c68f52aaf657462e6007de09991aebb4fd8676 (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
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "runit-${version}";
  version = "2.1.2";

  src = fetchurl {
    url = "http://smarden.org/runit/${name}.tar.gz";
    sha256 = "065s8w62r6chjjs6m9hapcagy33m75nlnxb69vg0f4ngn061dl3g";
  };

  phases = [ "unpackPhase" "patchPhase" "buildPhase" "checkPhase" "installPhase" ];

  patches = [ ./Makefile.patch ];

  buildPhase = ''
    cd ${name}
    make -C 'src'
  '';

  checkPhase = ''
    make -C 'src' check
  '';

  installPhase = ''
    mkdir -p $out/bin
    for f in $(cat package/commands); do
      mv src/$f $out/bin/
    done
  '';

  meta = with stdenv.lib; {
    description = "UNIX init scheme with service supervision";
    license = licenses.bsd3;
    homepage = "http://smarden.org/runit";
    maintainers = with maintainers; [ rickynils ];
    platforms = platforms.linux;
  };
}