wok rev 4602
Add nvidia (proprietary drivers and lib)
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Mon Dec 14 15:51:46 2009 +0000 (2009-12-14) |
parents | 2c869c285fe0 |
children | 87aa391a4860 |
files | nvidia/receipt |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nvidia/receipt Mon Dec 14 15:51:46 2009 +0000 1.3 @@ -0,0 +1,103 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="nvidia" 1.7 +VERSION="190.42" 1.8 +CATEGORY="network" 1.9 +MAINTAINER="jozee@slitaz.org" 1.10 +SHORT_DESC="NVIDIA drivers (non-free)" 1.11 +DEPENDS="linux xorg-server" 1.12 +BUILD_DEPENDS="$DEPENDS" 1.13 +WEB_SITE="http://www.nvidia.com/" 1.14 +SOURCE="NVIDIA-Linux-x86-${VERSION}-pkg0" 1.15 +TARBALL="${SOURCE}.run" 1.16 +TAGS="drivers graphic video" 1.17 + 1.18 +# Rules to configure and make the package. 1.19 + 1.20 +compile_rules() { 1.21 + KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.22 + WGET_URL="http://download.nvidia.com/XFree86/Linux-x86/$VERSION/$TARBALL" 1.23 + 1.24 + [ -d $WOK/linux/taz ] || tazwok cook linux 1.25 + 1.26 + cd $WOK/$PACKAGE 1.27 + [ -f $TARBALL ] || wget $WGET_URL 1.28 + 1.29 + chmod +x $TARBALL 1.30 + sh $TARBALL --extract-only 1.31 + 1.32 + cd $SOURCE/usr/src/nv/ 1.33 + make SYSSRC="$WOK/linux/linux-$KERNEL_VERSION" module 1.34 +} 1.35 + 1.36 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.37 +genpkg_rules() 1.38 +{ 1.39 + KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.40 + EXTRAVERSION=_$KERNEL_VERSION 1.41 + _pkg="$WOK/$PACKAGE/$SOURCE" 1.42 + 1.43 + mkdir -p $fs/usr/share $fs/usr/lib/X11 $fs/usr/share/licenses/$PACKAGE \ 1.44 + $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video 1.45 + 1.46 + # Compress and install module 1.47 + lzma e $_pkg/usr/src/nv/nvidia.ko \ 1.48 + $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz 1.49 + chown root $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz 1.50 + chmod 0644 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz 1.51 + 1.52 + cp -a $_pkg/LICENSE $fs/usr/share/licenses/$PACKAGE 1.53 + cp -a $_pkg/usr/bin $fs/usr 1.54 + cp -a $_pkg/nvidia-installer $fs/usr/bin 1.55 + cp -a $_pkg/usr/lib/*.so* $fs/usr/lib/ 1.56 + cp -a $_pkg/usr/lib/tls $fs/usr/lib/ 1.57 + cp -a $_pkg/usr/share/pixmaps $fs/usr/share 1.58 + cp -a $_pkg/usr/share/doc $fs/usr/share 1.59 + cp -a $_pkg/usr/X11R6/lib/* $fs/usr/lib/X11 1.60 + 1.61 + 1.62 +} 1.63 + 1.64 +pre_install() 1.65 +{ 1.66 + echo "" 1.67 + echo -e "\033[1m PROPRIETARY LICENSE:\033[0m $2" 1.68 + echo "================================================================================" 1.69 + echo "You are installing a package with proprietary license." 1.70 + echo "You must accept the license." 1.71 + echo "================================================================================" 1.72 + echo "" 1.73 + 1.74 +} 1.75 + 1.76 +post_install() 1.77 +{ 1.78 + echo "Processing post-install commands..." 1.79 + chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz 1.80 + 1.81 + echo "" 1.82 + echo -e "\033[1m NVIDIA LICENSE INFORMATION:\033[0m $2" 1.83 + echo "================================================================================" 1.84 + echo "For installing this package, you have to accept the $PACKAGE license." 1.85 + echo "The license is stored in /usr/share/licenses/$PACKAGE " 1.86 + echo -n "Would you like to read the license (y/N) : "; read anser 1.87 + if [ "$anser" = "y" ]; then 1.88 + cat /usr/share/licenses/"$PACKAGE"/LICENSE | more 1.89 + echo "" 1.90 + fi 1.91 + echo "================================================================================" 1.92 + echo -n "Do you accept the license (y/N) : "; read anser 1.93 + if [ "$anser" = "N" ]; then 1.94 + echo "You did not accept the license, Removing the pkg." 1.95 + tazpkg remove "$PACKAGE" 1.96 + fi 1.97 + 1.98 +} 1.99 + 1.100 +post_remove() 1.101 +{ 1.102 + echo "Processing post-remove commands..." 1.103 + depmod -a 1.104 +} 1.105 + 1.106 +