wok-next rev 12682
get-java6-jre: be generic
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 01 21:54:01 2012 +0200 (2012-05-01) |
parents | c3875c19b172 |
children | 76dabc3432a1 |
files | get-java6-jre/stuff/get-java6-jre |
line diff
1.1 --- a/get-java6-jre/stuff/get-java6-jre Tue May 01 18:24:36 2012 +0200 1.2 +++ b/get-java6-jre/stuff/get-java6-jre Tue May 01 21:54:01 2012 +0200 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.sh" 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 @@ -50,6 +52,7 @@ 1.28 1.29 1.30 # Make the package 1.31 +VERSION="$(ls jre?.* -d | sed 's/^jre//')" 1.32 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java 1.33 # use mv instead of 'cp -a' to save RAM 1.34 mv jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java 1.35 @@ -70,7 +73,7 @@ 1.36 CATEGORY="non-free" 1.37 SHORT_DESC="SUN Java Runtime." 1.38 DEPENDS="xorg-libXtst" 1.39 -WEB_SITE="http://www.java.com/" 1.40 +WEB_SITE="$WEB_SITE" 1.41 1.42 post_install() 1.43 { 1.44 @@ -98,6 +101,9 @@ 1.45 1.46 # Install pseudo package 1.47 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 1.48 +case " $@ " in 1.49 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 1.50 +esac 1.51 1.52 # Clean 1.53 cd $CUR_DIR