diff --git a/debian/rtl8821cu-dkms.postinst b/debian/rtl8821cu-dkms.postinst new file mode 100644 index 0000000..e301748 --- /dev/null +++ b/debian/rtl8821cu-dkms.postinst @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (C) 2002-2005 Flavio Stanchina +# Copyright (C) 2005-2006 Aric Cyr +# Copyright (C) 2007 Mario Limonciello +# Copyright (C) 2009 Alberto Milone + +set -e + +NAME=rtl8821cu +PACKAGE_NAME=$NAME-dkms +DEB_NAME=$(echo $PACKAGE_NAME | sed 's,_,-,') +CVERSION=`dpkg-query -W -f='${Version}' $DEB_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` +ARCH=`dpkg-architecture -qDEB_BUILD_GNU_CPU` + +dkms_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" + return $? + fi + echo "WARNING: $POSTINST does not exist." >&2 + done + echo "ERROR: DKMS version is too old and $PACKAGE_NAME was not" >&2 + echo "built with legacy DKMS support." >&2 + echo "You must either rebuild $PACKAGE_NAME with legacy postinst" >&2 + echo "support or upgrade DKMS to a more current version." >&2 + return 1 +} + +case "$1" in + configure) + dkms_configure + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + + +exit 0 diff --git a/debian/rtl8821cu-dkms.prerm b/debian/rtl8821cu-dkms.prerm new file mode 100644 index 0000000..275f49a --- /dev/null +++ b/debian/rtl8821cu-dkms.prerm @@ -0,0 +1,30 @@ +#!/bin/sh + +NAME=rtl8821cu +VERSION=5.4.1 + +set -e + +case "$1" in + remove|upgrade|deconfigure) + if [ "`dkms status -m $NAME`" ]; then + dkms remove -m $NAME -v $VERSION --all + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + + +exit 0 + + + + diff --git a/debian/rules b/debian/rules index 3636f5f..3262690 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,8 @@ override_dh_auto_install: dh_install -prtl8821cu-dkms -X.o -X.ko platform/ usr/src/rtl8821cu-$(VERSION) dh_install -prtl8821cu-dkms -X.o -X.ko include/ usr/src/rtl8821cu-$(VERSION) dh_install -prtl8821cu-dkms Makefile usr/src/rtl8821cu-$(VERSION) - dh_install -prtl8821cu-dkms rtl8821c.mk usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms rtl8821c.mk usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms dkms.conf usr/src/rtl8821cu-$(VERSION) install -d $(XDIR)/debian cd debian && install rules.m-a ../$(XDIR)/debian/rules && cp -r *modules.in* changelog copyright compat *_KVERS_* ../$(XDIR)/debian/ cd debian/rtl8821cu-src/usr/src && cp -a ../../../rtl8821cu-dkms/usr/src/rtl8821cu-$(VERSION)/* modules/rtl8821cu-src/ && XZ_OPT=-9 tar --xz -c -f rtl8821cu.tar.xz modules && rm -rf modules