Category Image DarwinPorts and example installation of tcpflow port


I needed to use tcpflow the other day for the first time since I got my Intel Macbook Pro running Tiger. I downloaded and installed Marc Liyanage's Panther installer sicne no Tiger installer available. I figured it might work, but it did not. I really needed to use this excellent tool, so after a quick Google search, I came across the tcpflow port in DarwinPorts. Now I was familiar with DarwinPorts, but had never looked at it in detail or installed it. So, after understanding it a little, I just installed it and then used it to install (download, fetch, make, build, install, etc) in one easy command. This was a really simple, smooth and pleasant experience.....

In the back of your mind, you might have visions of your whole system being messed up by using something like a fink or darwinports, but for sure that is not the case. Fink, for example puts all its files in a new top-level directory, the /sw directory. DarwinPorts puts all its files in a new directory named /opt/local. The objective here is that the programs installed by DarwinPorts are independent of OS X, so some duplication of dependent libraries might exist. In any case, DarwinPorts is a very painless way of getting the latest up to date unix tools compiled from source and installed in your machine.

To install DarwinPorts , simply download the dmg package installer and run it.

The installer adds the executable directories to your shell classpath.

After installation, relaunch Terminal and try
$ man port

Next bring the installation up to date by doing
$ sudo port -d selfupdate

If you get a command not found, then check your /etc/profile file (I assume you are using the bash shell). In my case, the installer had put semi-colons ( ; ), which is the default Windows path separator, between the directories in the classpath. I replaced those with colons ( : ), the standard unix path separator, and saved it. Then everything worked fine after that.

You can browse the installation in terminal by doing
$ cd /opt/local

The darwinports program "port" is in
/opt/local/bin

When you install new programs, most probably they go in this folder too.

Using DarwinPorts is very easy. Bookmark this port command short reference page . Now you are ready to install tcpflow in one easy step. Simply type

$ sudo port install tcpflow

That's it. Now try out tcpflow. For airport use en1, for wired internet use en0. Then run the following command in terminal and them go surf the web and watch the tcp data whizz by in the terminal.

$ sudo tcpflow -i en1 -c port 80

Press ctrl-C to stop the tcpflow program.

Posted: Thursday - May 04, 2006 at 08:23 AM        


Published by