summary refs log tree commit diff
path: root/pkgs/tools/system/at/default.nix
blob: 2964db34e1243104ff670876f245ac44fc8db394 (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
{ fetchurl, stdenv, bison, flex, pam, ssmtp }:

stdenv.mkDerivation {
  name = "at-3.1.14";

  src = fetchurl {
    # Debian is apparently the last location where it can be found.
    url = mirror://debian/pool/main/a/at/at_3.1.14.orig.tar.gz;
    sha256 = "cd092bf05d29c25b286f55a960ce8b8c3c5beb571d86ed8eb1dfb3b61291b3ae";
  };

  patches = [ ./install.patch ];

  buildInputs =
    [ bison flex pam
      # `configure' and `atd' want the `sendmail' command.
      ssmtp
    ];

  preConfigure =
    ''
      export PATH="${ssmtp}/sbin:$PATH"

      # Purity: force atd.pid to be placed in /var/run regardless of
      # whether it exists now.
      substituteInPlace ./configure --replace "test -d /var/run" "true"
    '';

  configureFlags =
    ''
       --with-etcdir=/etc/at
       --with-jobdir=/var/spool/atjobs --with-atspool=/var/spool/atspool
       --with-daemon_username=atd --with-daemon_groupname=atd
    '';

  meta = {
    description = ''The classical Unix `at' job scheduling command'';
    license = stdenv.lib.licenses.gpl2Plus;
    homepage = http://packages.qa.debian.org/at;
  };
}