3

I have macports installed and it's using the default /opt/local location. There are a few packages not in macports and some I tools I wrote that I put in ~/bin. I found myself needing to use these tools by multiple users on my machine and I don't want to have to copy the same binaries over to each user directory.

/opt is a typical suggestion for third-party software and that's why macports uses /opt/local. However, it doesn't seem like a good idea to put non-macports packages in /opt/local. /usr is also commonly suggested but I should probably stay away from that for the same reason macports decided not to use it.

It seems that macports exists entirely in /opt/local, so I am inclined to create a new directory in /opt, like /opt/somename, and mimic the structure to have /opt/somename/lib /opt/somename/bin etc...

Perhaps I'm a bit anal, but I can't come up with a name for this directory that makes sense. /opt/local would have been appropriate, and I wish macports had used /opt/macports instead. But I'd rather use as much default config as possible so I don't want to change macport's default directory.

So my question is two parts:

  1. What would you call your custom-package directory in /opt
  2. If you disagree with putting the stuff in /opt/somname or anything else in my strategy above, then would you suggest a reasonable, fairly isolated alternative.

I'm really interested in how people have tackled this in their own environments, and I'm surprised I haven't been able to find any info on this. Also, I realize one option is to just create my own port, but I would like to specifically address the two questions above.

2
  • /usr/local is perfectly fine to use, at least it's not occupied by default in any OS X installation. Only Homebrew uses it.
    – slhck
    Oct 12, 2012 at 18:48
  • That's also part of the problem I have. I'm looking for a location where I can be sure nothing will use that location except for me, but doesn't seem very arbitrary like putting something in /. I figure this may seem like a contrived example, but I have seen people with both homebrew and macports, what would you do in that case?
    – vopilif
    Oct 12, 2012 at 21:11

1 Answer 1

0

It seems to me that you're placing too much emphasis on your directory not being "arbitrary". On the mac, even /opt is arbitrary, as it's not an integral part of the OS, and there is no /opt directory until you create one (or macports does). Once you accept that, your new directory is just a name and some permissions, and there's nothing special about the name.

Fink uses /sw. On the one hand, this might be even more "arbitrary" than /opt, as I've never noticed it on any of the linuxes I've played with. On the other hand, all of my macs have a /sw dir with a bunch of binaries (somewhere) in there – because I use fink – so you could go ahead and use that if you really want to use a name somebody else has used before (assuming you're not using fink yourself). =)

But really, any name will do. It really, really doesn't matter. If your main criterion is using a directory unlikely to be used by anything else, invent the name yourself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .