Monday, June 30, 2008

Darwin Ports

Since I had started to work with Mac OS X, I feel some missing command tools in the shell, as Linux user you have some favorite commands, besides the servers runs with tcsh, not bash, so many of my bash scripts do not work. I tried to use some Perl based scripts to complement some commands, but today I found the project Darwin Ports, an OpenSource alternative to use common Unix tools from source.

Some requirements include Xcode and X11, so install it first.

First you need to download the installer from their website, it is a common .dmg package, so open and install following the screen instructions. Easy.

Next you need to open a terminal and edit the .profile in the HOME, adding the lines:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
export EDITOR=/usr/bin/pico

After this, you require to create a new shell or simply open a new terminal. Now we check for updates with:
sudo port -d selfupdate

Now you can add new programs using port commands like:
sudo port install PACKAGE

The program and dependencies sources are downloaded, compiled and installed. Cool!

To search in the available ports:
port search PACKAGE
port variants PACKAGE

More information about a package:
port info PACKAGE

List of installed packages:
port installed

And finally if you need more information, visit their Wiki.

No comments:

Post a Comment