summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ttysnoop/default.nix
blob: 670c96083443c350c1a5e3daf8d058a8773714ba (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
{stdenv, fetchurl}:
let
  s = # Generated upstream information
  rec {
    baseName="ttysnoop";
    version="0.12d.k26";
    name="${baseName}-${version}";
    hash="0jb2zchaiqmmickj0la7wjw3sf9vy65qfhhs11yrzx4mmwkp0395";
    url="http://sysd.org/stas/files/active/0/ttysnoop-0.12d.k26.tar.gz";
    sha256="0jb2zchaiqmmickj0la7wjw3sf9vy65qfhhs11yrzx4mmwkp0395";
  };
  buildInputs = [
  ];
in
stdenv.mkDerivation {
  inherit (s) name version;
  inherit buildInputs;
  src = fetchurl {
    inherit (s) url sha256;
  };
  preBuild = ''
    sed -e "s@/sbin@$out/sbin@g" -i Makefile
    sed -e "s@/usr/man@$out/share/man@g" -i Makefile
    mkdir -p "$out/share/man/man8"
    mkdir -p "$out/sbin"
  '';
  postInstall = ''
    mkdir -p "$out/etc"
    cp snooptab.dist "$out/etc/snooptab"
  '';
  meta = {
    inherit (s) version;
    description = "A tool to clone input and output of another tty/pty to the current one";
    license = stdenv.lib.licenses.gpl2 ;
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
  };
}