I live on the unix command line. Many mac users gasp in horror when the see me at a prompt that they think is "DOS" or something. They think I've broken my Macbook Pro and this is the way I 'fix' it. When I try to explain to them that I'm more at home with a keyboard and a blinking cursor than with a mouse/touchpad inside a GUI they just don't get it. On the other side you have people who say "well if you like the command line so much why not just use Ubuntu". The short answer is: with very few exceptions (Slackware, Gentoo and Funtoo), every Linux distribution I've used makes me want to slap the developers and stab the users/zealots who peddle that crap. <FlameOff>
While I've never been much of a fan of NetBSD in particular, one would have to concede that they did a really good thing by making pkgsrc so flexible. The fact that runs on every modern Unix(-like) system is just plain awesome. Since OS X is Unix, pkgsrc just fits. I've used fink (bleh), macports (nice but much less flexible) and Homebrew (great but very incomplete). In fact I still use Homebrew as my defualt solution for unix tools. The problem is that they are pretty restrictive as to what they will accept and the formulae tend to be pretty slim on options. So when I need more flexibility in what available I reach for pkgsrc.
One of the pluses with homebrew is that it expects to be installed in /usr/local and to have all of it's packages installed and linked under /usr/local/
- Make sure Xcode is installed
- As an admin user :
- sudo mkdir -p /usr/local/src
- sudo chown -R [USERID]:staff /usr/local/ #replace [USERID] with your normal user id
- sudo chmod 775 /usr/local/*
- As normal (unprivileged) user:
- Install homebrew:
- ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
- Install git:
- brew install git
- update brew formulae (just incase):
- brew update
- Install pkgsrc:
- cd /usr/local/
- curl ftp://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2011Q1/pkgsrc.tar.gz | tar xzvf -
- cd pkgsrc/bootstrap
- ./bootstrap --pkgdbdir /usr/local/var/db/pkg --unprivileged --prefix /usr/local/pkg
At step 3.4.2 we use the tarball path given at http://www.netbsd.org/docs/software/packages.html#bootstrap This path will likely change in the near future. So get the latest copy for your purposes.
In 3.4.4 we setup pkgsrc to install to /usr/local/pkg so more of our binaries will be in /usr/local/pkg/bin or /usr/local/pkg/sbin. It's important to modify your PATH and MANPATH variables. You generally want pkgsrc apps to be found AFTER their homebrew counterparts. If you don't know what those last to sentences mean, please stop before you break your computer.
In the end you'll have a working pkgsrc install alongside your homebrew install. You can install packages from either system without needing to escalate to an administrative user.