Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / hylafaxplus / post-install.sh
blobddc7c3f85eda5d737fcaacd3faff5a80e35885c4
1 # Parts of the `install` make target don't
2 # dare to set file modes (or owners), but put the
3 # needed commands in a new file called `root.sh`.
4 # We execute the `chmod` commands of
5 # this script to set execute bits.
6 sed '/chown/d;/chgrp/d' --in-place root.sh
7 . root.sh
9 # We run `faxsetup` to prepare some config files
10 # that the admin would have to create otherwise.
11 # Since `faxsetup` is quite picky about its environment,
12 # we have to prepare some dummy files.
13 # `faxsetup` stores today's date in the output files,
14 # so we employ faketime to simulate a deterministic date.
15 echo "uucp:x:0" >> "$TMPDIR/passwd.dummy" # dummy uucp user
16 touch "$out/spool/etc/config.dummy" # dummy modem config
17 mkdir "$TMPDIR/lock.dummy" # dummy lock dir
18 "@libfaketime@/bin/faketime" -f "$(date --utc --date=@$SOURCE_DATE_EPOCH '+%F %T')" \
19 "@fakeroot@/bin/fakeroot" -- \
20 "$out/spool/bin/faxsetup" -with-DIR_LOCKS="$TMPDIR/lock.dummy" -with-PASSWD="$TMPDIR/passwd.dummy"
21 rm "$out/spool/etc/config.dummy"
23 # Ensure all binaries are reachable within the spooling area.
24 ln --symbolic --target-directory="$out/spool/bin/" "$out/bin/"*