~ubuntu-branches/ubuntu/maverick/nvidia-graphics-drivers-96/maverick-proposed

« back to all changes in this revision

Viewing changes to debian/nvidia-96-kernel-source.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Milone
  • Date: 2010-01-08 23:34:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100108233451-f1142o5r7z0ou4o0
Tags: 96.43.14-0ubuntu1
* Rework packaging taking Mandriva's as a model:
  - Use alternatives instead of diversions.
  - Reduce the number of binary packages to nvidia-96,
    nvidia-96-dev and nvidia-96-modaliases.
* debian/rules:
  - Switch to CDBS.
  - Remove libGL.la as no static library is provided.
* debian/nvidia-current.README.Debian.in:
  - Document the update process.
* nvidia-current.postinst: try to build the module for the most
  recent kernel in addition to building it for the current kernel
  (LP: #474917).
* New upstream release (LP: #494166):
 - Add support for xserver 1.7.x.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Copyright (C) 2002-2005 Flavio Stanchina
3
 
# Copyright (C) 2005-2006 Aric Cyr
4
 
# Copyright (C) 2007 Mario Limonciello
5
 
# Copyright (C) 2007 Alberto Milone
6
 
 
7
 
#DEBHELPER#
8
 
 
9
 
PKGVER=`dpkg-query -W -f='${Version}' nvidia-96-kernel-source | awk -F "-" '{print $1}'`
10
 
PKGVER=${PKGVER#*:}
11
 
 
12
 
SOURCES=/var/lib/dkms/nvidia/
13
 
VERSION=96.44.09
14
 
STATUS=$(dpkg --compare-versions "$PKGVER" lt "$VERSION" && echo "True" || echo "False")
15
 
 
16
 
case "$1" in
17
 
        configure)
18
 
                # act only if the version of the current package is lower than $VERSION
19
 
                if [ "$STATUS" = "True" ] && [ -d $SOURCES ]; then
20
 
                        echo "Cleaning up the DKMS tree"
21
 
                        for directory in $(ls $SOURCES); do
22
 
                                kind=$(echo "$directory" | awk '$1 ~ /.*[a-z].*$/ { print "alpha"; next } { print "num" }')
23
 
                                # the names of the directories containing the version of the driver are digits (e.g. 177.70)
24
 
                                if [ "$kind" = "num" ]; then
25
 
                                        comparison=$(echo "$directory" | awk -v Version="$PKGVER" '($1 != Version) { print "yes"; next } { print "no" }')
26
 
                                        # if the version is less than $VERSION
27
 
                                        if [ "$comparison" = "yes" ]; then
28
 
                                                rm -rf $SOURCES$directory 2>/dev/null
29
 
                                        fi
30
 
                                fi
31
 
                        done
32
 
                        echo "Done."
33
 
                fi
34
 
                
35
 
                echo "Removing all DKMS Modules"
36
 
                dkms remove -m nvidia -v $PKGVER --all -q > /dev/null
37
 
                echo "Done."
38
 
                echo "Adding Module to DKMS build system"
39
 
                echo "driver version= $PKGVER"
40
 
                dkms add -m nvidia -v $PKGVER > /dev/null
41
 
                echo "Doing initial module build"
42
 
                dkms build -m nvidia -v $PKGVER > /dev/null
43
 
                echo "Installing initial module"
44
 
                dkms install -m nvidia -v $PKGVER > /dev/null
45
 
                echo "Done."
46
 
        ;;
47
 
esac
48
 
 
49