wok view get-java6-jdk/stuff/get-java6-jdk @ rev 20603
Update iptraf & gcc3
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 17 12:19:32 2018 +0100 (2018-12-17) |
parents | e5dde73f1ac9 |
children |
line source
1 #!/bin/sh -e
2 # Get and install the SUN Java Development Kit
3 #
4 # (C) 2007-2008 SliTaz - GNU General Public License v3.
5 # Based on get-java6-jre by Eric Joseph-Alexandre <erjo@slitaz.org>
6 # Author : Kévin DA SILVA <dasilvakevin@hotmail.fr>
8 PACKAGE="java6-jdk"
9 VERSION="1.6.0_13"
10 URL="http://raphaello.univ-fcomte.fr/ftp/java/Jdk"
11 TARBALL="jdk-6u13-linux-i586.bin"
12 TEMP_DIR="$(mktemp -d)"
13 ROOT="$1"
15 # Check if we are root starting anything
16 if [ $(id -u) -ne 0 ]; then
17 echo -e "\nYou must be root to run $(basename $0)."
18 echo -e "Please type 'su' and root password to become super-user.\n"
19 rm -rf "$TEMP_DIR"
20 exit 1
21 fi
23 # Avoid reinstall
24 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
25 echo -e "\n$PACKAGE package is already installed.\n"
26 rm -rf "$TEMP_DIR"
27 exit 1
28 fi
30 # Check if java6-jre is installed
31 if [ -d $ROOT/var/lib/tazpkg/installed/java6-jre ]; then
32 echo -e "\njava6-jre must be uninstalled before install java6-jdk.\n"
33 rm -rf "$TEMP_DIR"
34 exit 2
35 fi
38 # Create TEMP_DIR
39 CUR_DIR=$(pwd)
40 cd $TEMP_DIR
42 # Download the file
43 test -f $TARBALL || wget $URL/$TARBALL
44 if [ ! -f $TARBALL ]; then
45 cd $CUR_DIR
46 rm -rf "$TMP_DIR"
47 echo "Could not download $TARBALL. Exiting."
48 exit 1
49 fi
51 # Do not trust 'df' free space
52 sed -i 's/exit 3$//' $TARBALL
54 # Run the install file user may agree to SUN EULA
55 chmod +x $TARBALL
56 ./${TARBALL}
58 # Make the package
59 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
61 # use mv instead of 'cp -a' to save RAM
62 mv jdk${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
64 # extracted pkg can be removed: Save RAM
65 rm -rf $TARBALL
67 # Delete unecessary files
68 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jdk${VERSION}/man
70 # Create receipt
72 cat > $PACKAGE-$VERSION/receipt <<EOT
73 # SliTaz package receipt.
75 PACKAGE="$PACKAGE"
76 VERSION="$VERSION"
77 CATEGORY="non-free"
78 SHORT_DESC="SUN Java Development Kit."
79 DEPENDS="xorg-libXtst"
80 WEB_SITE="http://www.java.com/"
82 post_install()
83 {
84 cd /usr/lib/firefox*/plugins
85 ln -s /usr/lib/java/jdk\$VERSION/jre/plugin/i386/ns7/libjavaplugin_oji.so
87 #lien mit dans red5 /usr/bin/javajdk
88 cd /usr/bin
89 ln -s /usr/lib/java/jdk\$VERSION/bin/java
90 ln -s /usr/lib/java/jdk\$VERSION/bin/javac
91 ln -s /usr/lib/java/jdk\$VERSION/bin/javadoc
92 ln -s /usr/lib/java/jdk\$VERSION/bin/javap
93 }
95 post_remove()
96 {
97 rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
98 rm -f /usr/bin/java
99 }
100 EOT
102 # Pack
103 tazpkg pack $PACKAGE-$VERSION
105 # Clean to save RAM memory
106 rm -rf $PACKAGE-$VERSION
108 # Install pseudo package
109 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
111 # Clean
112 cd $CUR_DIR
113 rm -rf "$TEMP_DIR"