The 2 files I've attached, when put into the debian folder should get dkms to build the modules.

I should know, I help maintain the Ubuntu package.
#!/bin/sh

set -e

NAME="open-vm-tools"
PACKAGE_NAME="open-vm-dkms"
CVERSION="$(dpkg-query -W -f='${Version}' ${PACKAGE_NAME} | awk -F "-" '{ print 
$1 }' | cut -d\: -f2)"
ARCH=$(dpkg --print-architecture)

case "${1}" in
        configure)
                for POSTINST in /usr/lib/dkms/common.postinst 
/usr/share/${PACKAGE_NAME}/postinst
                do
                        if [ -f ${POSTINST} ]
                        then
                                ${POSTINST} ${NAME} ${CVERSION} 
/usr/share/${PACKAGE_NAME} ${ARCH} ${2}
                                exit ${?}
                        fi

                        echo "WARNING: ${POSTINST} does not exist."
                done

                echo "ERROR: DKMS version is too old and ${PACKAGE_NAME} was 
not"
                echo "built with legacy DKMS support."
                echo "You must either rebuild ${PACKAGE_NAME} with legacy 
postinst"
                echo "support or upgrade DKMS to a more current version."
                exit 1
                ;;

        abort-upgrade|abort-remove|abort-deconfigure)

                ;;

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

#DEBHELPER#

exit 0
#!/bin/sh

NAME="open-vm-tools"
PACKAGE_NAME="open-vm-dkms"
CVERSION="$(dpkg-query -W -f='${Version}' ${PACKAGE_NAME} | awk -F "-" '{ print 
$1 }' | cut -d\: -f2)"

set -e

case "${1}" in
        remove|upgrade|deconfigure)
                if [  "$(dkms status -m ${NAME})" ]
                then
                        dkms remove -m ${NAME} -v ${CVERSION} --all
                fi
                ;;

        failed-upgrade)

                ;;

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

#DEBHELPER#

exit 0

Reply via email to