wok-next view get-java6-jre/stuff/get-java6-jre.sh @ rev 1125
Add: get and install java runtime.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Tue Jul 22 01:08:56 2008 +0200 (2008-07-22) |
parents | |
children | c33837889abb |
line source
1 #!/bin/sh
2 # Get and install the SUN Java Runtime Environnement
3 #
4 # (C) 2007-2008 SliTaz - GNU General Public License v3.
5 #
6 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>
8 PACKAGE="java6-jre"
9 VERSION="1.6.0_07"
10 URL="http://javadl.sun.com/webapps/download/AutoDL?BundleId=23103"
11 TARBALL="jre-6u7-linux-i586.bin"
12 TEMP_DIR="/tmp/$PACKAGE.$$"
14 # Check if we are root starting anything
15 if test $(id -u) != 0 ; then
16 echo -e "\nYou must be root to run `basename $0`."
17 echo -e "Please type 'su' and root password to become super-user.\n"
18 exit 1
19 fi
21 # Avoid reinstall
22 if [ -d /var/lib/tazpkg/installed/$PACKAGE ]; then
23 echo -e "\n$PACKAGE package is already installed.\n"
24 exit 1
25 fi
29 # Create TEMP_DIR
30 test -d $TEMP_DIR || mkdir $TEMP_DIR
31 cd $TEMP_DIR
33 # Doanload the file
34 test -f $TARBALL || wget $URL -O $TARBALL
36 # Run the install file user may agree to SUN EULA
37 chmod +x $TARBALL
38 ./${TARBALL}
41 # Make the package
42 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
43 cp -a jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
46 #delete unecessary files
47 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jre${VERSION}/man
49 # Create receipt
51 cat > $PACKAGE-$VERSION/receipt <<EOT
52 # SliTaz package receipt.
54 PACKAGE="$PACKAGE"
55 VERSION="$VERSION"
56 CATEGORY="non-free"
57 SHORT_DESC="SUN Java Runtime."
58 DEPENDS=""
59 WEB_SITE="http://www.java.com/"
61 post_install()
62 {
63 echo "Processing post install commands..."
64 if [ -d /usr/lib/firefox-3.0.1 ]; then
65 cd /usr/lib/firefox-3.0.1/plugins
66 ln -s /usr/lib/java/jre\$VERSION/plugin/i386/ns7/libjavaplugin_oji.so
67 fi
69 cd /usr/bin
70 ln -s /usr/lib/java/jre\$VERSION/bin/java
71 }
73 post_remove()
74 {
75 rm -f /usr/lib/firefox-3.0.1/plugins/libjavaplugin_oji.so
76 rm -f /usr/bin/java
77 }
78 EOT
80 # Pack
81 tazpkg pack $PACKAGE-$VERSION
83 # Install pseudo package
84 tazpkg install $PACKAGE-$VERSION.tazpkg
86 # Clean
87 cd /tmp
88 rm -rf $TEMP_DIR