In Linux, according to the Filesystem Hierarchy Standard, /opt is the designated location for add-on application software packages. Thus, when developing my own software package, which is not a dependency for anything else, I would place that in /opt/somepackage, with a hierarchy of my choice underneath.
FreeBSD, according to the link above, does not strictly follow the FHS but installs third-party packages into /usr/local. OPNsense, which is based on FreeBSD, installs its own code (at least in part) into /usr/local/opnsense. The hier manpage on FreeBSD makes no mention of /opt – thus a package installing itself in that location would be unlikely to collide with anything else, but would introduce a top-level path that is almost as exotic as installing straight to /somepackage.
What would be the appropriate installation location in FreeBSD? /usr/local/somepackage instead of /opt/somepackage, again with a hierarchy of my choice underneath?
Note that I have seen the following posts, which provide some insight but don’t fully answer my question:
- In Linux I'd use "/opt" for custom software. In FreeBSD? – asks specifically about software not managed by the package manager, whereas I am asking about developing my own
.pkg. - What might be an equivalent to Linux /opt/ in OpenBSD? – asks about OpenBSD, which may be different from FreeBSD