Generate the FreeBSD package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.
```
echo /path/to/command >x.sh
fpm -n x -s dir -t freebsd -a all --before-install x.sh .
```
pkginstall-y--no-repo-update./x-1.0.txz
Evidence
Upstream reference
Environment
Local host
Compatibility
Linux reference. macOS compatibility has not been checked for this command and execution context.