@marcus: "Cross-posting this to freebsd-ports because it's mostly about the  
ports infrastructure and how I might (ab)use it...
I'm looking into setting up jails, and was hoping I was onto something  
with using ports to maintain application software but I hit a snag and  
I'm hoping someone can either tell me how to do what I want or at  
least say "nope...you're on crack thinking that will work" ;)
I'm trying to set up a number of jails on my system following the  
handbook suggestions for "Application of Jails"  
(<url>  That means I have a master read-only instance for the base system (world), and read-write instances of key directories for each jail.  This is ideal for what I'd like to do because I only have to do one world upgrade to upgrade all my  
jails.
I'd like to extend that idea to a number of common ports.  For  
instance, I'd like to have gettext, libtool, etc., installed once and  
be able to do a single portupgrade to update it for all jails.
My initial plan was to make an /opt folder in the master filesystem  
and use the master jail to install ports (PREFIX=/opt and  
LOCALBASE=/opt).  I added the /opt/bin and /opt/sbin to the path and  
/opt/lib to the ld_config directories for the child jails and they  
were indeed able to see the first couple of ports I installed.
However, I started hitting issues with libtool and friends.  The  
children would not find them, and would go ahead and start installing  
their own local copies of those ports.  Turns out quite a few tools  
are defined in /usr/ports/Mk/* and are defined relative to LOCALBASE.   
If I leave LOCALBASE and PREFIX alone in the child jails so they'll  
use /usr/local for their specific ports, I can't recognize and use  
other ports like libtool installed in /opt; it doesn't seem right to  
set LOCALBASE in the child jails since I want them to use /usr/local  
for anything I haven't provided.
I really would like to avoid the "joy" of making hard-links, etc., for  
all the files in the common packages, but I didn't see any way to  
override settings for these individual ports.  I did edit some  
Makefiles and add 'prefix=/opt' to the CONFIGURE_ARGS for those  
ports, and everything worked fine, but I'd prefer to do it "the right  
way" (e.g. not editing Makefiles).
Is there a variable I'm not seeing that would allow me to do this kind  
of crazy thing, or am I better off either setting up hard links and/or  
using automated package building and just repeating pkg_upgrades in  
each jail?
If it's the latter, does someone know of a decent all-in-one doc to  
help me at least set up some features so I update ports once in a  
master and just get packages from the same place (I can piece it  
together myself from all the other docs I've found and been reading,  
but if someone has already written it up, hate to reinvent it myself  
:) ).
Thanks in advance.
Marcus I. Ryan, <email_address>
People often find it easier to be a result
of the past than a cause of the future."
    @fbsdquestions: "<quote>
Yeah, I feel your pain. You can't really do this with ports that require 
libraries from other ports. The ports system was created with the assumption 
that LOCALBASE (and PREFIX) for one installation (one PKG_DBDIR) is the same.
There are some exceptions, or rather, for some things it can work but 
libraries in general don't and libtool is even pickier. I only have 
bash-static, sudo and vim shared in /opt, as they are stand-alone and no 
ports I use depend on them.
The only thing I can think of that would work for you, is to use unionfs 
for /usr/local.
Mel
Problem with today's modular software: they start with the modules
    and never get to the software part."
{'source': 'USENET', 'other_information': '{"reply_count": 1, "forum_name": "lucky.freebsd.ports.20140828.mbox"}', 'file': 'data/output/usenet-lucky.freebsd.parquet'}