summarylogtreecommitdiffstats
path: root/smartcam.install
blob: 5bdc3deb0018ae62b51a01acd82e6808d830e0f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
post_install() {
    DKMS=`which dkms 2>/dev/null`

    echo " .. DKMS: Module add, build, and install "

    $DKMS add  -m smartcam -v 1.4.0
    $DKMS build -m smartcam -v 1.4.0
    $DKMS install -m smartcam -v 1.4.0

    echo
    echo "Before running smartcam, issue modprobe videodev; modprobe smartcam"
    echo "and install symbian package (.sis) from /usr/share/smartcam/phone_installs"
    echo "on your phone."
    echo
    update-desktop-database -q
    gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
    /sbin/depmod
    /bin/true
}

pre_upgrade()
{
    pre_remove
}

post_upgrade()
{
    post_install
}

pre_remove()
{
    DKMS=`which dkms 2>/dev/null`
    echo " .. DKMS: Module uninstall "

    line=`$DKMS status -m smartcam`
    if echo "$line" | grep -E 'added|built|installed'; then
        version=`echo "$line" | sed "s/smartcam,\([^,]*\)[,:].*/\1/;t;d"`
        $DKMS remove -m smartcam -v $version --all
    fi
}

post_remove()
{
    update-desktop-database -q
    gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
    /sbin/depmod -a
    /bin/true
}

op=$1
shift

$op "$@"