OpenPKG Advent Calendar 2006

...every day a little pondering, backstage information, jokes, tips and tricks.
9
Saturday 2006-12-09: Tips & Tricks
Required Dependency Packages

The difference between a focus on
problems and a focus on solutions:

When NASA began the launch of astronauts into space, they found that the pens wouldn't work at zero gravity (ink wouldn't flow down to the writing surface). In order to solve the problem, they hired Anderson Consulting. It took them one decade and twelve million dollars. They developed a pen that worked at zero gravity, upside down, under water, on practically any surface including crystal and in temperature range from below freezing to over 300 degrees C.

The Russians used a pencil...

The openpkg build tool is a sophisticated but complex (and sometimes also confusing) tool. One of my favorite openpkg build usage hacks is to ask it in advance what particular dependency packages have to be build (from scratch and in valid build order) for a particular solution.

For instance, the following particular hack answers what exact dependency packages of OpenPKG-CURRENT have to be built first (in order) before an Apache with mod_ssl and mod_php and PHP's GD extension can be build:

$ openpkg build \
  -r ftp://ftp.openpkg.org/current/ \
  -z -M -D with_mod_ssl -D with_mod_php \
  -D with_mod_php_gd apache |\
  perl -e '@p=<>;print(join"\n",reverse map{(split(/\s+/,$_))[2]}grep{!/^#/}@p)."\n"'

The output on 2006-12-02 was something like:

      openpkg-20061129-20061129
      mm-1.4.2-20061013
      make-3.81-20061013
      binutils-2.17-20061117
      zlib-1.2.3-20061013
      gcc-4.1.1-20061114
      db-4.5.20.0-20061110
      gdbm-1.8.3-20061013
      m4-1.4.8-20061121
      bison-2.3-20061013
      sed-4.1.5-20061013
      perl-5.8.8-20061013
      openssl-0.9.8d-20061013
      curl-7.16.0-20061030
      flex-2.5.33-20061013
      png-1.2.14-20061128
      pcre-6.7-20061013
      grep-2.5.1a-20061013
      freetype-2.2.1-20061013
      jpeg-6b-20061013
      gd-2.0.33-20061013