#! /bin/sh -e

if [ "$1" = configure ]; then
  if [ -d /usr/include/@PVER@ ] && [ ! -h /usr/include/@PVER@ ]; then
    if rmdir /usr/include/@PVER@ 2> /dev/null; then
      ln -sf @PVER@mu /usr/include/@PVER@
    else
      echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@"
      ls -l /usr/include/@PVER@
    fi
  fi
  if [ -d /usr/lib/@PVER@/config ] && [ ! -h /usr/lib/@PVER@/config ]; then
    if rmdir /usr/lib/@PVER@/config 2> /dev/null; then
      ln -sf config-@VER@mu /usr/lib/@PVER@/config
    else
      echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config"
      ls -l /usr/lib/@PVER@/config
    fi
  fi
fi

#DEBHELPER#

exit 0
