wok-current view nvidia/receipt @ rev 5069
improve nvidia receipt; update DEPENDS
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Fri Mar 12 11:26:56 2010 +0000 (2010-03-12) |
parents | d6cd66a2b5fc |
children | 7ab24a6af72d |
line source
1 # SliTaz package receipt.
3 PACKAGE="nvidia"
4 VERSION="190.42"
5 CATEGORY="network"
6 MAINTAINER="jozee@slitaz.org"
7 SHORT_DESC="NVIDIA drivers (non-free)"
8 DEPENDS="linux xorg-server gtk+ cairo-xcb linux-agp"
9 BUILD_DEPENDS="$DEPENDS"
10 WEB_SITE="http://www.nvidia.com/"
11 SOURCE="NVIDIA-Linux-x86-${VERSION}-pkg0"
12 TARBALL="${SOURCE}.run"
13 TAGS="drivers graphic video"
15 # Rules to configure and make the package.
17 compile_rules() {
18 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
19 WGET_URL="http://download.nvidia.com/XFree86/Linux-x86/$VERSION/$TARBALL"
21 [ -d $WOK/linux/taz ] || tazwok cook linux
23 cd $WOK/$PACKAGE
24 [ -f $TARBALL ] || wget $WGET_URL
26 chmod +x $TARBALL
27 sh $TARBALL --extract-only
29 cd $SOURCE/usr/src/nv/
30 make SYSSRC="$WOK/linux/linux-$KERNEL_VERSION" module
31 }
33 # Rules to gen a SliTaz package suitable for Tazpkg.
34 genpkg_rules()
35 {
36 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
37 EXTRAVERSION=_$KERNEL_VERSION
38 _pkg="$WOK/$PACKAGE/$SOURCE"
40 mkdir -p $fs/usr/share $fs/usr/lib/X11 $fs/usr/share/licenses/$PACKAGE \
41 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video \
42 $fs/usr/share/doc/$PACKAGE \
43 $fs/usr/share/applications
45 # Compress and install module
46 lzma e $_pkg/usr/src/nv/nvidia.ko \
47 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
48 chown root $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
49 chmod 0644 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
51 cp -a $_pkg/LICENSE $fs/usr/share/licenses/$PACKAGE
52 cp -a $_pkg/usr/bin $fs/usr
53 cp -a $_pkg/nvidia-installer $fs/usr/bin
54 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib/
55 cp -a $_pkg/usr/lib/tls $fs/usr/lib/
56 cp -a $_pkg/usr/share/pixmaps $fs/usr/share
57 cp -a $_pkg/usr/share/doc/* $fs/usr/share/doc/$PACKAGE/
58 cp -a $_pkg/usr/X11R6/lib/* $fs/usr/lib/X11
60 }
62 pre_install()
63 {
64 echo ""
65 echo -e "\033[1m PROPRIETARY LICENSE:\033[0m $2"
66 echo "================================================================================"
67 echo "You are installing a package with proprietary license."
68 echo "You must accept the license."
69 echo "================================================================================"
70 echo ""
72 }
74 post_install()
75 {
76 echo "Processing post-install commands..."
77 chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
79 # correct .desktop file file
80 sed -i 's:__UTILS_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
81 sed -i 's:__PIXMAP_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
83 echo ""
84 echo -e "\033[1m NVIDIA LICENSE INFORMATION:\033[0m $2"
85 echo "================================================================================"
86 echo "For installing this package, you have to accept the $PACKAGE license."
87 echo "The license is stored in /usr/share/licenses/$PACKAGE "
88 echo -n "Would you like to read the license (y/N) : "; read anser
89 if [ "$anser" = "y" ]; then
90 cat /usr/share/licenses/"$PACKAGE"/LICENSE | more
91 echo ""
92 fi
93 echo "================================================================================"
94 echo -n "Do you accept the license (y/N) : "; read anser
95 if [ "$anser" = "N" ]; then
96 echo "You did not accept the license, Removing the pkg."
97 tazpkg remove "$PACKAGE"
98 fi
100 }
102 post_remove()
103 {
104 echo "Processing post-remove commands..."
105 depmod -a
106 }
108 TAZBB_NO_INSTALL="because this is not hardware neutral"