wok view get-java6-jre/stuff/get-java6-jre.sh @ rev 1614

subversion depends on cyrus-sasl
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 19 20:48:49 2008 +0000 (2008-10-19)
parents c33837889abb
children 7d89161a7786
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 for i in /usr/lib/firefox*; do
65 [ -d \$i ] || continue
66 cd \$i/plugins
67 ln -s /usr/lib/java/jre\$VERSION/plugin/i386/ns7/libjavaplugin_oji.so
68 done
70 cd /usr/bin
71 ln -s /usr/lib/java/jre\$VERSION/bin/java
72 }
74 post_remove()
75 {
76 rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
77 rm -f /usr/bin/java
78 }
79 EOT
81 # Pack
82 tazpkg pack $PACKAGE-$VERSION
84 # Install pseudo package
85 tazpkg install $PACKAGE-$VERSION.tazpkg
87 # Clean
88 cd /tmp
89 rm -rf $TEMP_DIR