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 opt/singularity/singularity.new

if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database 1> /dev/null &> /dev/null
fi
( cd opt/singularity/lib ; rm -rf libfusion-1.4.so.5 )
( cd opt/singularity/lib ; ln -sf libfusion-1.4.so.5.0.4 libfusion-1.4.so.5 )
( cd opt/singularity/lib ; rm -rf libdirect-1.4.so )
( cd opt/singularity/lib ; ln -sf libdirect-1.4.so.5 libdirect-1.4.so )
( cd opt/singularity/lib ; rm -rf libuuid.so.16 )
( cd opt/singularity/lib ; ln -sf libuuid.so.16.0.22 libuuid.so.16 )
( cd opt/singularity/lib ; rm -rf libapr-1.so.0 )
( cd opt/singularity/lib ; ln -sf libapr-1.so.0.4.5 libapr-1.so.0 )
( cd opt/singularity/lib ; rm -rf libdb.so )
( cd opt/singularity/lib ; ln -sf libdb-5.1.so libdb.so )
( cd opt/singularity/lib ; rm -rf libssl.so )
( cd opt/singularity/lib ; ln -sf libssl.so.1.0.0 libssl.so )
( cd opt/singularity/lib ; rm -rf libaprutil-1.so.0 )
( cd opt/singularity/lib ; ln -sf libaprutil-1.so.0.4.1 libaprutil-1.so.0 )
( cd opt/singularity/lib ; rm -rf libdirectfb-1.4.so.5 )
( cd opt/singularity/lib ; ln -sf libdirectfb-1.4.so.5.0.4 libdirectfb-1.4.so.5 )
( cd opt/singularity/lib ; rm -rf libapr-1.so )
( cd opt/singularity/lib ; ln -sf libapr-1.so.0.4.5 libapr-1.so )
( cd opt/singularity/lib ; rm -rf libexpat.so )
( cd opt/singularity/lib ; ln -sf libexpat.so.1.5.2 libexpat.so )
( cd opt/singularity/lib ; rm -rf libdb-5.so )
( cd opt/singularity/lib ; ln -sf libdb-5.1.so libdb-5.so )
( cd opt/singularity/lib ; rm -rf libexpat.so.1 )
( cd opt/singularity/lib ; ln -sf libexpat.so.1.5.2 libexpat.so.1 )
( cd opt/singularity/lib ; rm -rf libuuid.so )
( cd opt/singularity/lib ; ln -sf libuuid.so.16.0.22 libuuid.so )
( cd opt/singularity/lib ; rm -rf libtcmalloc_minimal.so.0 )
( cd opt/singularity/lib ; ln -sf libtcmalloc_minimal.so.0.2.2 libtcmalloc_minimal.so.0 )
( cd opt/singularity/lib ; rm -rf libaprutil-1.so )
( cd opt/singularity/lib ; ln -sf libaprutil-1.so.0.4.1 libaprutil-1.so )
( cd opt/singularity/lib ; rm -rf libfusion-1.4.so )
( cd opt/singularity/lib ; ln -sf libfusion-1.4.so.5 libfusion-1.4.so )
( cd opt/singularity/lib ; rm -rf libhunspell-1.3.so.0 )
( cd opt/singularity/lib ; ln -sf libhunspell-1.3.so.0.0.0 libhunspell-1.3.so.0 )
( cd opt/singularity/lib ; rm -rf libSDL-1.2.so.0 )
( cd opt/singularity/lib ; ln -sf libSDL-1.2.so.0.11.3 libSDL-1.2.so.0 )
( cd opt/singularity/lib ; rm -rf libdirect-1.4.so.5 )
( cd opt/singularity/lib ; ln -sf libdirect-1.4.so.5.0.4 libdirect-1.4.so.5 )
( cd opt/singularity/lib ; rm -rf libdirectfb-1.4.so )
( cd opt/singularity/lib ; ln -sf libdirectfb-1.4.so.5 libdirectfb-1.4.so )
( cd opt/singularity/lib ; rm -rf libSDL-1.2.so )
( cd opt/singularity/lib ; ln -sf libSDL-1.2.so.0 libSDL-1.2.so )
( cd opt/singularity/lib ; rm -rf libcrypto.so )
( cd opt/singularity/lib ; ln -sf libcrypto.so.1.0.0 libcrypto.so )
