~jon-raiford/mythbuntu/lirc

« back to all changes in this revision

Viewing changes to debian/lirc-modules-source.postinst

  • Committer: Mario Limonciello
  • Date: 2009-10-10 04:37:04 UTC
  • Revision ID: superm1@ubuntu.com-20091010043704-lycmm6818njtbp1h
* lirc-modules-source.postinst:
  - Update to use the DKMS common postinst template.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# Copyright (C) 2007-2008 Mario Limonciello
3
3
set -e
4
4
 
5
 
CVERSION=`dpkg-query -W -f='${Version}' lirc-modules-source | awk -F "-" '{print $1}'`
 
5
NAME=lirc
 
6
PACKAGE_NAME=$NAME-modules-source
 
7
CVERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2`
 
8
 
 
9
ARCH=`dpkg --print-architecture`
 
10
case $ARCH in
 
11
        amd64)
 
12
                ARCH="x86_64"
 
13
                ;;
 
14
        lpia)
 
15
                ARCH="i686"
 
16
                ;;
 
17
        i386)
 
18
                ARCH="i686"
 
19
                ;;
 
20
        *)
 
21
                echo "WARNING: unsupported arch: $ARCH"
 
22
                ARCH="$ARCH"
 
23
                ;;
 
24
esac
 
25
 
 
26
case "$1" in
 
27
        configure)
 
28
                for POSTINST in /usr/lib/dkms/common.postinst /usr/share/$PACKAGE_NAME/postinst; do
 
29
                        if [ -f $POSTINST ]; then
 
30
                                $POSTINST $NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2
 
31
                                exit $?
 
32
                        fi
 
33
                        echo "WARNING: $POSTINST does not exist."
 
34
                done
 
35
                echo "ERROR: DKMS version is too old and $PACKAGE_NAME was not"
 
36
                echo "built with legacy DKMS support."
 
37
                echo "You must either rebuild $PACKAGE_NAME with legacy postinst"
 
38
                echo "support or upgrade DKMS to a more current version."
 
39
                exit 1
 
40
        ;;
 
41
 
 
42
        abort-upgrade|abort-remove|abort-deconfigure)
 
43
        ;;
 
44
 
 
45
        *)
 
46
                echo "postinst called with unknown argument \`$1'" >&2
 
47
                exit 1
 
48
        ;;
 
49
esac
6
50
 
7
51
#DEBHELPER#
8
 
 
9
 
case "$1" in
10
 
        configure)
11
 
                echo "Adding Module to DKMS build system"
12
 
                dkms add -m lirc -v $CVERSION > /dev/null
13
 
                echo "Doing initial module build"
14
 
                dkms build -m lirc -v $CVERSION > /dev/null
15
 
                echo "Installing initial module"
16
 
                dkms install -m lirc -v $CVERSION --force > /dev/null
17
 
                echo "Done."
18
 
        ;;
19
 
esac
20
 
 
21