Subject: bsetroot in {black,open}box
To: None <>
From: Jan Schaumann <>
List: tech-pkg
Date: 11/20/2002 11:50:10

In PR pkg/19107, there is a package for the openbox window manager.
Openbox is a fork of Blackbox, and uses two tools that are part of
Blackbox' PLIST, namely bsetroot and bsetbg (as well as their respective
man-pages).  It is not desirable to have these two packages conflict for
this -- the tools are merely used to set the background in their themes
(which can be shared among the two versions).

So the dilemma is, how to have these packages install the same files
without conflicting?

One very hackish way around this is to have each blackbox's and
openbox's PLISTS do the following, after installing the files in
question into their 'share' directories:

@exec [ -f %D/bin/bsetbg ] || ${LN} -s %D/bin/bsetbg %D/share/openbox/bsetbg
@exec [ -f %D/bin/bsetroot ] || ${LN} -s %D/bin/bsetroot %D/share/openbox/bsetroot
@exec [ -f %D/man/man1/bsetbg.1 ] || ${LN} -s %D/man/man1/bsetbg %D/share/openbox/bsetbg.1
@exec [ -f %D/man/man1/bsetroot.1 ] || ${LN} -s %D/man/man1/bsetroot %D/share/openbox/bsetroot.1
@unexec ( [ -f %D/share/blackbox/bsetbg ] && ${LN} -sf %D/share/blackbox/bsetbg %D/bin/bsetbg ) || ${TRUE}
@unexec ( [ -f %D/share/blackbox/bsetroot ] && ${LN} -sf %D/share/blackbox/bsetroot %D/bin/bsetroot ) || ${TRUE}
@unexec ( [ -f %D/share/blackbox/bsetbg.1 ] && ${LN} -sf %D/share/blackbox/bsetbg.1 %D/man/man1/bsetbg.1 ) || ${TRUE}
@unexec ( [ -f %D/share/blackbox/bsetroot.1 ] && ${LN} -sf %D/share/blackbox/bsetroot.1 %D/man/man1/bsetroot.1 ) || ${TRUE}

(This goes into openbox's PLIST, in blackbox's you'd swap the 'openbox'
and 'blackbox' names in the exec and unexecs.)

This seems to work ok for now:  if you install openbox after blackbox,
openbox will simply use the bsetbg provided by blackbox -- if you
uninstall blackbox, the link will be adjusted and openbox is still
happy.  (Same thing vice versa.)

Now the problem is that it's conceivable that either window manager
upgrades or changes their version of bsetroot so that the other one can
no longer use it, in which case this would break.  Also, there is at
least one other fork of Blackbox -- hackedbox -- which also uses these
tools.  When we include hackedbox in pkgsrc, we'd have to add another
test and further mess around with these.

Another solution would be to extract bsetroot from either one tarball
and create a separate package of it, on which all other boxes would
depend.  Here, as well, the problem would arise should either at some
point use a different version that somehow is incompatible with the
other (unlikely, given their common codebase, but possible).

Renaming the tools is not an option, as the window managers currently
can (and should) share themes by using the same commands.

So... build a separate bsetroot package and hope the window managers
will continue to use the same version?  Is that the best solution?
Other ideas?


"Ford," he said, "you're turning into a penguin. Stop it."