#!/bin/sh
config() {
  NEW="$1"
  OLD="`dirname $NEW`/`basename $NEW .new`"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
config etc/X11/fvwm2/system.fvwm2rc.new
( cd usr/bin ; rm -rf fvwm )
( cd usr/bin ; ln -sf fvwm2 fvwm )
( cd usr/bin ; rm -rf fvwm-root )
( cd usr/bin ; ln -sf xpmroot fvwm-root )
( cd usr/lib/X11 ; rm -rf fvwm2 )
( cd usr/lib/X11 ; ln -sf ../../../etc/X11/fvwm2 fvwm2 )
( cd usr/man/man1 ; rm -rf fvwm-root.1.gz )
( cd usr/man/man1 ; ln -sf xpmroot.1.gz fvwm-root.1.gz )
( cd usr/libexec/fvwm/2.4.20 ; rm -rf FvwmAudio )
( cd usr/libexec/fvwm/2.4.20 ; ln -sf FvwmEvent FvwmAudio )
