wok view get-java6-jre/stuff/get-java6-jre @ rev 25735

Remove iptraf: replaced by iptraf-ng
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 23 09:39:49 2024 +0000 (2 months ago)
parents 02fddc35e8f8
children
line source
1 #!/bin/sh
2 # Get and install the SUN Java Runtime Environnement
3 #
4 # (C) 2007-2012 SliTaz - GNU General Public License v3.
5 #
6 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>
8 PACKAGE="java6-jre"
9 WEB_SITE="http://www.java.com/"
10 SHORT_DESC="SUN Java Runtime."
11 DEPENDS="xorg-libXtst"
12 TARBALL="jre.bin"
13 TEMP_DIR="$(mktemp -d)"
14 ROOT="$1"
16 URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
17 sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"
19 # Check if we are root starting anything
20 if [ $(id -u) -ne 0 ]; then
21 echo -e "\nYou must be root to run `basename $0`."
22 echo -e "Please type 'su' and root password to become super-user.\n"
23 rm -rf "$TEMP_DIR"
24 exit 1
25 fi
27 # Avoid reinstall
28 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
29 echo -e "\n$PACKAGE package is already installed.\n"
30 rm -rf "$TEMP_DIR"
31 exit 1
32 fi
36 # Create TEMP_DIR
37 CUR_DIR=$(pwd)
38 cd $TEMP_DIR
40 # Download the file
41 test -f $TARBALL || wget $URL -O $TARBALL
42 if [ ! -f $TARBALL ]; then
43 cd $CUR_DIR
44 rm -rf "$TEMP_DIR"
45 echo "Could not download $TARBALL. Exiting."
46 exit 1
47 fi
49 # Do not trust 'df' free space
50 sed -i 's/exit 3$//' $TARBALL
52 # Run the install file user may agree to SUN EULA
53 chmod +x $TARBALL
54 sh ${TARBALL}
57 # Make the package
58 VERSION="$(ls jre?.* -d | sed 's/^jre//')"
59 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
60 # use mv instead of 'cp -a' to save RAM
61 mv jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
63 # extracted pkg can be removed: Save RAM
64 rm -rf $TARBALL
66 #delete unecessary files
67 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jre${VERSION}/man
69 # Create receipt
71 cat > $PACKAGE-$VERSION/receipt <<EOT
72 # SliTaz package receipt.
74 PACKAGE="$PACKAGE"
75 VERSION="$VERSION"
76 CATEGORY="non-free"
77 SHORT_DESC="$SHORT_DESC"
78 DEPENDS="$DEPENDS"
79 WEB_SITE="$WEB_SITE"
81 post_install()
82 {
83 [ -d /usr/lib/mozilla/plugins ] || mkdir -p /usr/lib/mozilla/plugins
84 ln -s /usr/lib/java/jre\$VERSION/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins
86 cd /usr/bin
87 ln -s /usr/lib/java/jre\$VERSION/bin/java
88 }
90 post_remove()
91 {
92 rm -f /usr/lib/mozilla/plugins/libnpjp2.so
93 rm -f /usr/bin/java
94 }
95 EOT
97 # Pack
98 tazpkg pack $PACKAGE-$VERSION
100 # Clean to save RAM memory
101 rm -rf $PACKAGE-$VERSION
103 # Install pseudo package
104 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
105 case " $@ " in
106 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
107 esac
109 # Clean
110 cd $CUR_DIR
111 rm -rf "$TEMP_DIR"