#!/bin/sh
set -e

case "$1" in
    configure)
        # Restore the .so extension for the shared library
        if [ -f /usr/lib/libspacemit_base_control ]; then
            mv /usr/lib/libspacemit_base_control /usr/lib/libspacemit_base_control.so
            chmod 644 /usr/lib/libspacemit_base_control.so
            echo "ai-toy: Restored libspacemit_base_control.so"
        fi

        # Run ldconfig to update shared library cache
        if [ -x /sbin/ldconfig ]; then
            /sbin/ldconfig
        fi
        ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        # Do nothing in these cases
        ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac

#DEBHELPER#

exit 0

