It doesn't seem like I can specify the timeout for a package postinstall script, only if I specify a script for a specific bundle. Would you agree?
According to the man page, the timeout attribute can not be customized for global preinstall or postinstall scripts.
According to the PackageInfo file that is created by pkgbuild tool on macOS Sequoia, the timeout attribute is set for the global preinstall or postinstall scripts and the value is 600. So it would be interesting to check whether just incrementing this value works (as one would expect) or this is not possible because of a hardcoded maximum value for the timeout for global scripts.
It is possible to edit the PackageInfo info by:
expanding the .pkg with pkgutil --expand
editing the PackageInfo file with your favorite text editor.
flattening the directory to produce a new .pkg with pkgutil --flatten.
e.g.
<?xml version="1.0" encoding="utf-8"?>
<pkg-info overwrite-permissions="true" relocatable="false" identifier="inc.acme.emptypayload" postinstall-action="none" version="1.0" format-version="2" generator-version="InstallCmds-860.14 (24G90)" auth="root">
<payload numberOfFiles="1" installKBytes="0"/>
<bundle-version/>
<upgrade-bundle/>
<update-bundle/>
<atomic-update-bundle/>
<strict-identifier/>
<relocate/>
<scripts>
<preinstall file="./preinstall" timeout="600"/>
</scripts>
</pkg-info>