wok-current rev 12789
get-java6-jre: fix generic with tar
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Tue May 15 21:40:57 2012 +0000 (2012-05-15) |
parents | fa56b3d2ddf6 |
children | 3fb06f5aae55 e2b4ebabd30f |
files | get-java6-jre/stuff/get-java6-jre |
line diff
1.1 --- a/get-java6-jre/stuff/get-java6-jre Tue May 15 14:36:55 2012 +0000 1.2 +++ b/get-java6-jre/stuff/get-java6-jre Tue May 15 21:40:57 2012 +0000 1.3 @@ -1,17 +1,19 @@ 1.4 #!/bin/sh 1.5 # Get and install the SUN Java Runtime Environnement 1.6 # 1.7 -# (C) 2007-2008 SliTaz - GNU General Public License v3. 1.8 +# (C) 2007-2012 SliTaz - GNU General Public License v3. 1.9 # 1.10 # Author : Eric Joseph-Alexandre <erjo@slitaz.org> 1.11 1.12 PACKAGE="java6-jre" 1.13 -VERSION="1.6.0_31" 1.14 -URL="http://javadl.sun.com/webapps/download/AutoDL?BundleId=59621" 1.15 -TARBALL="jre-6u31-linux-i586.bin" 1.16 +WEB_SITE="http://www.java.com/" 1.17 +TARBALL="jre.tar.gz" 1.18 TEMP_DIR="/tmp/$PACKAGE.$$" 1.19 ROOT="$1" 1.20 1.21 +URL="$(wget -O - ${WEB_SITE}en/download/manual.jsp | \ 1.22 + sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')" 1.23 + 1.24 # Check if we are root starting anything 1.25 if test $(id -u) != 0 ; then 1.26 echo -e "\nYou must be root to run `basename $0`." 1.27 @@ -46,10 +48,11 @@ 1.28 1.29 # Run the install file user may agree to SUN EULA 1.30 chmod +x $TARBALL 1.31 -./${TARBALL} 1.32 +tar xvf ${TARBALL} 1.33 1.34 1.35 # Make the package 1.36 +VERSION="$(ls jre?.* -d | sed 's/^jre//')" 1.37 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java 1.38 # use mv instead of 'cp -a' to save RAM 1.39 mv jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java 1.40 @@ -70,7 +73,7 @@ 1.41 CATEGORY="non-free" 1.42 SHORT_DESC="SUN Java Runtime." 1.43 DEPENDS="xorg-libXtst" 1.44 -WEB_SITE="http://www.java.com/" 1.45 +WEB_SITE="$WEB_SITE" 1.46 1.47 post_install() 1.48 { 1.49 @@ -98,6 +101,9 @@ 1.50 1.51 # Install pseudo package 1.52 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 1.53 +case " $@ " in 1.54 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 1.55 +esac 1.56 1.57 # Clean 1.58 cd $CUR_DIR