wok-current rev 13408
get-virtualbox: add x86_64 support.
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Sep 30 14:29:08 2012 +0200 (2012-09-30) |
parents | 31a6c59885ff |
children | 1916b7d701ea |
files | get-virtualbox/stuff/get-virtualbox |
line diff
1.1 --- a/get-virtualbox/stuff/get-virtualbox Sat Sep 29 09:53:53 2012 +0000 1.2 +++ b/get-virtualbox/stuff/get-virtualbox Sun Sep 30 14:29:08 2012 +0200 1.3 @@ -1,7 +1,12 @@ 1.4 #!/bin/sh -e 1.5 1.6 +PACKAGE=${0#*get-} 1.7 +WEB_SITE=http://www.virtualbox.org/ 1.8 +SHORT_DESC="x86 virtualization." 1.9 +DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev mesa libglu-mesa" 1.10 +BUILD_DEPENDS="slitaz-toolchain bzip2 linux-source python python-dev coreutils-command" 1.11 + 1.12 ROOT="$1" 1.13 -PACKAGE=${0#*get-} 1.14 1.15 if test $(id -u) != 0 ; then 1.16 echo -e "\nYou must be root to run `basename $0`." 1.17 @@ -10,18 +15,22 @@ 1.18 fi 1.19 1.20 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then 1.21 - [ -n "$ROOT" ] && exit 1 1.22 - tazpkg remove $PACKAGE 1.23 - [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 1.24 + [ -n "$ROOT" ] && exit 1 1.25 + tazpkg remove $PACKAGE 1.26 + [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 1.27 fi 1.28 [ -d $ROOT/usr/share/$PACKAGE ] && rm -rf $ROOT/usr/share/$PACKAGE 1.29 1.30 -WEB_SITE=http://www.virtualbox.org/ 1.31 -SHORT_DESC="x86 virtualization." 1.32 +case "$(uname -m)" in 1.33 +i?86) linux_run="Linux_x86.run" ;; 1.34 +x86_64) linux_run="Linux_amd64.run" ;; 1.35 +esac 1.36 + 1.37 dl_url() 1.38 { 1.39 - wget --no-check-certificate -O - ${WEB_SITE}wiki/Linux_Downloads 2> /dev/null | \ 1.40 - grep Linux_x86.run | sed 's|.*href="\(.*Linux_x86.run\).*|\1|' 1.41 + wget --no-check-certificate -O - \ 1.42 + ${WEB_SITE}wiki/Linux_Downloads 2> /dev/null | \ 1.43 + grep $linux_run | sed 's|.*href="\(.*'$linux_run'\).*|\1|' 1.44 } 1.45 1.46 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM 1.47 @@ -42,7 +51,7 @@ 1.48 exit 1 1.49 fi 1.50 1.51 -VERSION=${TARBALL%-Linux_x86.run*} 1.52 +VERSION=${TARBALL%-$linux_run*} 1.53 VERSION=${VERSION#VirtualBox-} 1.54 1.55 sed -i 's/df -kP/df -k/' $TARBALL 1.56 @@ -50,7 +59,6 @@ 1.57 # Extract 1.58 sh $TARBALL --noexec --keep 1.59 1.60 -BUILD_DEPENDS="slitaz-toolchain bzip2 linux-source python python-dev coreutils-command" 1.61 for i in $BUILD_DEPENDS; do 1.62 [ -d /var/lib/tazpkg/installed/$i ] && continue 1.63 yes y | tazpkg get-install $i 1.64 @@ -85,25 +93,25 @@ 1.65 CATEGORY="non-free" 1.66 SHORT_DESC="$SHORT_DESC" 1.67 WEB_SITE="$WEB_SITE" 1.68 -DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev mesa libglu-mesa" 1.69 +DEPENDS="$DEPENDS" 1.70 1.71 pre_remove() 1.72 { 1.73 - sed -i 's/$MODULE_LIST //' \$1/etc/rcS.conf 1.74 - chroot "\$1/" delgroup vboxusers 1.75 + sed -i 's/$MODULE_LIST //' \$1/etc/rcS.conf 1.76 + chroot "\$1/" delgroup vboxusers 1.77 } 1.78 1.79 post_install() 1.80 { 1.81 $(grep ' udev[atp]' install/install.sh) 1.82 - chroot "\$1/" depmod -a $(uname -r) 1.83 - [ -n "\$1" ] || for i in $MODULE_LIST; do modprobe \$i ; done 1.84 - grep -qs vboxdrv \$1/etc/rcS.conf || 1.85 - sed -i 's/^LOAD_MODULES="/&$MODULE_LIST /' \$1/etc/rcS.conf 1.86 - 1.87 - # Add vboxusers group 1.88 - grep -qs ^vboxusers \$1/etc/group || 1.89 - chroot "\$1/" addgroup vboxusers 1.90 + chroot "\$1/" depmod -a $(uname -r) 1.91 + [ -n "\$1" ] || for i in $MODULE_LIST; do modprobe \$i ; done 1.92 + grep -qs vboxdrv \$1/etc/rcS.conf || 1.93 + sed -i 's/^LOAD_MODULES="/&$MODULE_LIST /' \$1/etc/rcS.conf 1.94 + 1.95 + # Add vboxusers group 1.96 + grep -qs ^vboxusers \$1/etc/group || 1.97 + chroot "\$1/" addgroup vboxusers 1.98 } 1.99 EOT 1.100