wok-current view get-java6-jdk/stuff/get-java6-jdk @ rev 13014
Add libqwt6-qt4
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Jun 08 21:01:40 2012 +0200 (2012-06-08) |
parents | 6a80bcb8368d |
children | 6fab3264ba87 |
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="/tmp/$PACKAGE.$$"
13 ROOT="$1"
15 # Check if we are root starting anything
16 if test $(id -u) != 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 exit 1
20 fi
22 # Avoid reinstall
23 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
24 echo -e "\n$PACKAGE package is already installed.\n"
25 exit 1
26 fi
28 # Check if java6-jre is installed
29 if [ -d $ROOT/var/lib/tazpkg/installed/java6-jre ]; then
30 echo -e "\njava6-jre must be uninstalled before install java6-jdk.\n"
31 exit 2
32 fi
35 # Create TEMP_DIR
36 CUR_DIR=$(pwd)
37 test -d $TEMP_DIR || mkdir $TEMP_DIR
38 cd $TEMP_DIR
40 # Download the file
41 test -f $TARBALL || wget $URL/$TARBALL
42 if [ ! -f $TARBALL ]; then
43 cd $CUR_DIR
44 rm -rf $TMP_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 ./${TARBALL}
56 # Make the package
57 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
59 # use mv instead of 'cp -a' to save RAM
60 mv jdk${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
62 # extracted pkg can be removed: Save RAM
63 rm -rf $TARBALL
65 # Delete unecessary files
66 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jdk${VERSION}/man
68 # Create receipt
70 cat > $PACKAGE-$VERSION/receipt <<EOT
71 # SliTaz package receipt.
73 PACKAGE="$PACKAGE"
74 VERSION="$VERSION"
75 CATEGORY="non-free"
76 SHORT_DESC="SUN Java Development Kit."
77 DEPENDS="xorg-libXtst"
78 WEB_SITE="http://www.java.com/"
80 post_install()
81 {
82 echo -n "Processing post install commands..."
83 cd /usr/lib/firefox*/plugins
84 ln -s /usr/lib/java/jdk\$VERSION/jre/plugin/i386/ns7/libjavaplugin_oji.so
86 #lien mit dans red5 /usr/bin/javajdk
87 cd /usr/bin
88 ln -s /usr/lib/java/jdk\$VERSION/bin/java
89 ln -s /usr/lib/java/jdk\$VERSION/bin/javac
90 ln -s /usr/lib/java/jdk\$VERSION/bin/javadoc
91 ln -s /usr/lib/java/jdk\$VERSION/bin/javap
92 status
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