Where to put software not managed by pkg or ports?

I am trying to set up Nebula and want to properly store the binaries. I browsed through hier but it seems like there may be a few potential options. I don't know if
/usr/bin/, /usr/local/bin/, or some other directory would be best. The other issue is that nebula is also available in pkg, but it's an older version than what I'm using. I don't think it would get accidentally installed from pkg, and since it's a self contained binary it should be pretty easy to replace it with a newer release, but I would like to avoid this potential mistake if possible.

Is there a preferred directory for user installed software that is not managed by packages or ports?
 
It's not mentioned in hier(7) but /opt/ is a common place for it. Usually follows a similar structure; /opt/<appname>/bin, /opt/<appname>/lib, /opt/<appname>/etc, /opt/<appname>/var, etc.
Would $PATH automatically pick this up or do I need to include any new directories?
 
Personally, I put home-brew software that is not installed from packages or ports into the /usr/local hierarchy.

Editorial obnoxious comment: I find that to be a bad place, since there it is mixed with all the stuff from packages, which is NOT local. This is part of the FreeBSD hier(7) convention that I don't like. I would prefer to have 4 categories: The base OS (in /usr, sometimes in /bin or /sbin); optional software that was purchased or downloaded (in some older Unixes this was in /opt), for that); software that is not public, but local to a single host or a site (/usr/local makes sense), and finally stuff specific to one user (/home/<username>/bin/ and so on).
 
With only six files installed by the port, and you are not using the port, I'd go for:

/usr/local/

– and then if the port becomes desirable, you'll have very little housekeeping.
 
For anything not managed by FreeBSD ports/pkg, I'd say /usr/local is off limits completely. It'll interfere. If not today, then some day, and Murphy is not your friend.

I have a tendency to mount /home as noexec as well on anything important. So that would leave the undocumented (on FreeBSD) /opt, which is something of a convention in the rest of the UNIX world. To keep things from colliding, I'd install into /opt/<appname> and keep things separate instead of dropping everything straight into /opt.
 
For all my self-compiled SW that accepts it, I'd go with --prefix=/opt/local. This way you only have to add one directory to your PATH, /opt/local/bin (maybe also add /opt/local/man to MANPATH). You also avoid potential snags with ports/pkg-managed SW in /usr/local. You can also have both nebula versions simultaneously, and switch by rearranging your PATH.
 
Incidentally, from rc.conf(5):

… If local_startup contains /usr/local/etc/rc.d and /opt/conf, /usr/local/etc/rc.conf.d/jail and /opt/conf/rc.conf.d/jail will be loaded. …

(Added with 8eac80769b8e3817cea84c2d73e311114c03d938 in 2014.)
 
Back
Top