Subject: minimizing package dependencies
To: None <tech-pkg@netbsd.org>
From: Klaus Heinz <k.heinz.jul.zwei@onlinehome.de>
List: tech-pkg
Date: 07/16/2002 23:49:37
Hi,

if there's a choice which other packages a given package can depend on,
e.g. it works without them, but may work better or give additional options
if they are available, should I include those other packages or should
I make them optional with Makefile variables?

mail/p5-Mail-SpamAssassin works without net/p5-Net-DNS and time/p5-Time-HiRes
(SA detects them at run time). p5-Net-DNS is used very often by users
(DNS blacklist lookup) but p5-Time-HiRes is only needed if people need to
get timing statistics for spam scoring rules, mainly for development
purposes.

I thought about minimizing dependencies like this:

  SA_USE_DNS?=            NO
  SA_USE_TIME_HIRES?=     NO

  .if ${SA_USE_DNS} != "NO"
  DEPENDS+=               p5-Net-DNS-[0-9]*:../../net/p5-Net-DNS
  .endif
  .if ${SA_USE_TIME_HIRES} != "NO"
  DEPENDS+=               p5-Time-HiRes-[0-9]*:../../time/p5-Time-HiRes
  .endif

On the other hand, the typical user will probably not look at the Makefile
and will not notice those options. This is true especially for users
of binary packages, I think.

Maybe I should adopt a mixed approach: add p5-Net-DNS and make p5-Time-HiRes
optional.

ciao
     Klaus