audiobookshelf: 2.18.1 -> 2.19.0 (#378967)
[NixPkgs.git] / pkgs / by-name / fc / fcron / package.nix
blob40d47f912bd3567d3469f9c3aefb5c2e388c9b64
1 # restart using 'killall -TERM fcron; fcron -b
2 # use convert-fcrontab to update fcrontab files
5   lib,
6   stdenv,
7   fetchurl,
8   perl,
9   busybox,
10   vim,
13 stdenv.mkDerivation rec {
14   pname = "fcron";
15   version = "3.3.1";
17   src = fetchurl {
18     url = "http://fcron.free.fr/archives/${pname}-${version}.src.tar.gz";
19     sha256 = "sha256-81naoIpj3ft/4vlkuz9cUiRMJao2+SJaPMVNNvRoEQY=";
20   };
22   buildInputs = [ perl ];
24   patches = [ ./relative-fcronsighup.patch ];
26   configureFlags = [
27     "--with-sendmail=${busybox}/sbin/sendmail"
28     "--with-editor=${vim}/bin/vi" # TODO customizable
29     "--with-bootinstall=no"
30     "--localstatedir=/var"
31     "--sysconfdir=/etc"
32     "--with-rootname=root"
33     "--with-rootgroup=root"
34     "--disable-checks"
35   ];
37   installTargets = [ "install-staged" ]; # install does also try to change permissions of /etc/* files
39   # fcron tries to install pid into system directory on install
40   installFlags = [
41     "ETC=."
42     "PIDDIR=."
43     "PIDFILE=fcron.pid"
44     "REBOOT_LOCK=fcron.reboot"
45     "FIFODIR=."
46     "FIFOFILE=fcron.fifo"
47     "FCRONTABS=."
48   ];
50   preConfigure = ''
51     sed -i 's@/usr/bin/env perl@${perl}/bin/perl@g' configure script/*
52     # Don't let fcron create the group fcron, nix(os) should do this
53     sed -i '2s@.*@exit 0@' script/user-group
55     # --with-bootinstall=no shoud do this, didn't work. So just exit the script before doing anything
56     sed -i '2s@.*@exit 0@' script/boot-install
58     # also don't use chown or chgrp for documentation (or whatever) when installing
59     find -type f | xargs sed -i -e 's@^\(\s\)*chown@\1:@' -e 's@^\(\s\)*chgrp@\1:@'
60   '';
62   meta = with lib; {
63     description = "Command scheduler with extended capabilities over cron and anacron";
64     homepage = "http://fcron.free.fr";
65     license = licenses.gpl2Plus;
66     platforms = lib.platforms.all;
67   };