Soft dependencies, a.k.a. recommends

I will illustrate my rather general point with the CSWnagios package.

Difficult people like me prefer to minimize the packages on a system. CSWnagios is not part of Solaris and as such a likely candidate for installation. CSWnagios depends on CSWapache2. Apache2 is part of Solaris (SUNW) and as such gets support and patches from Oracle.

Nagios requires a webserver to function, but it does not need a specific version nor an specialized setup besides an include file with the nagios-specific apache configuration. I understand the strict division of CSW and system files, but in this case we are not mixing libraries nor binaries. In this case, the CSW package does not touch the system apache as such.

I don't have a clear answer, but I am thinking about these lines:

What do you think?

C.

asked: 2012-02-18 by: claudio


automaciej answers:

The idea sounds good. Don't make a hard dependency. Our tools currently don't have a notion of suggested packages, but you can add a postinstallation message to your package. I found an example how to do that.

You can create files/CSWnagios.postmsg and:

POSTMSG = $(docdir)/$(CATALOGNAME)/CSWnagios.postmsg
DISTFILES +=$(notdir $(POSTMSG)
...
post-merge:
    ginstall -d $(PKGROOT)$(dir $(POSTMSG))
    ginstall $(WORKDIR)/$(notdir $(POSTMSG)) $(PKGROOT)$(POSTMSG)

An additional package that binds Apache and Nagios also sounds like a workable idea.


bonivart answers:

We could add a field in the catalog for soft deps and pkgutil could at end of installation suggest to install them. Users less experienced could then just go ahead and get a working system and those that want to use other choices can do so.


automaciej commented:

It's an interesting idea. Would pkgutil ask you "do you want to install the soft deps too?" before the installation?


Dagobert answers:

This is at least also true for phpldapadmin which doesn't impost a dependency, neither to apache nor to php5 and especially not the needed php5_session module.


bonivart answers:

I went the other way with phpmyadmin including both apache2 and php5, I wanted it to be more complete and I think we should use our own stuff. Sun/Oracle has never been quick to patch stuff, I think we can beat them often, I know I do on ISC Bind and DHCP all the time, not to mention you still have what was reasonably fresh in 2005.

As you see I have the opposite view of the OP, maybe soft deps would be a good idea to bridge those views? Or that we simply start doing our stack packages we talked about in Dublin, we could have a SAMP package e.g. including everything. This could be done much more and then stuff like phpmyadmin wouldn't have to include apache2 and php5, you could instead install something like CSWphpmyadmin-stack.