Install a package .pkg into a custom directory

install

I need to install the gcc3.3 on my OS X 10.5.8 to try something. For that purpose, I need to install it into a custom directory, such as /usr/loca/gcc-3.3

By default, the gcc3.3.pkg installs itself directly into /usr/bin To change that default directory, I've tried this command line:

sudo installer -pkg ~/Downloads/gcc3.3.pkg -target /usr/local/gcc-3.3

but that didn't work and the installer installed it into /usr/bin

So how can I install a .pkg into a custom directory?

Best Answer

Try unpkg. It has worked flawlessly for me for several years.

unpkg solves the problem of installing a .pkg outside its intended location. You still have to figure out how to run gcc from that location. I assume it's a matter of setting the correct environment variables or setting symbolic links in /usr/local .