Port unpack and build

| No Comments

The macports (formerly Darwin Ports) is awesome for "building from source" many open source applications. On most of my Macs I use it to have a separate installation of Perl, Apache etc into /opt. That way I can install extra things without messing with the system versions of the software.

Most of the time all you have to do to install something is port install "package", for example

$ port install mod_perl2

This will download, compile and install perl, apache2 and mod_perl -- and all the dependencies needed for each of those. Easy, huh?

Once in a while though you need something slightly different than whatever it does automatically. For example rrdtool needed some help to properly build the Perl extensions. What to do? Seemed like a lot of work to find, download, configure and compile it all just for that! Aha - fancy options to the rescue:

With the following command it'd recompile and install rrdtool but leave the work files there:

$ port -dfk install rrdtool
  • -d - enable debug and verbose mode. I used this to get an output of the obscure path where the compiled rrdtool was
  • -f - do all the work again, even if it's been done before
  • -k - "keep", don't autoclean after install

The last option was what I really needed - it left all the work files there and let me go in and work with the rrdtool perl library to make it work for whatever it was I needed it to do.

For more options, type man port.

Leave a comment

About this Entry

This page contains a single entry by Ask Bjørn Hansen published on September 20, 2007 8:52 PM.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.33-en
/* bf */