I am wanting to install various IDEs, alongside the JDK, Android SDK, Tomcat, Glassfish, Ruby, Rails, Homebrew, Python, Django, PostgreSQL, etc, etc.
What are some best practices to set up a stable, flexible development environment on OS X, in relation to the following considerations (and any extras you can think of)
Install location: ~ (home) vs. / (root) vs. /usr/local
Install methods: Package manager(s) vs. app store vs. build from source vs. pre-built packages
Install preferences: Various places (install stuff with defaults) with symbolic links vs. one directory (/usr/loca/development for example)
Install nice-to-have's: Shell scripts to do stuff? Any tools for organising your development machine better?
Install Homebrew first, and get it to install as many of the other things as possible. For other packages, I like to install them in /opt, based on type and version. So for Tomcat, I might have /opt/tomcat/tomcat-7.0.1 and /opt/tomcat/tomcat-6.3.2. Then I link the version I like the best to "default". So:
ln -s /opt/tomcat/tomcat-7.0.1 /opt/tomcat/default. That way I can put /opt/tomcat/default into PATH statements (etc.) and if I ever need to change versions, I can just link a different Tomcat to default, and everything keeps humming along. You don't need to mess around with editing files or restarting your terminal. I used to do the same thing with Java, but now Macs have their own system for dealing with JDKs, and I've sort of accepted that.
By the way, here's a prompt command I like to use for terminal windows:
I found that somewhere, so I just vaguely understand how it works. It shows basic information about your session, but what's cool is it uses green text when the previous command was successful (0 return status) and changes to red if it failed. Gimmicky goodness! Put it into your .bash_profile and you'll see it every time you open a terminal. It looks better on a black background though, so keep that in mind.