wok rev 2735

Add get-java6-jdk (Thanks Kevin)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 24 16:02:51 2009 +0200 (2009-04-24)
parents a7f7f7a86f55
children d9e1ced7774b
files get-java6-jdk/receipt get-java6-jdk/stuff/get-java6-jdk
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-java6-jdk/receipt	Fri Apr 24 16:02:51 2009 +0200
     1.3 @@ -0,0 +1,18 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-java6-jdk"
     1.7 +VERSION="1.0"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="SUN Java Development Kit"
    1.10 +MAINTAINER="dasilvakevin@hotmail.fr"
    1.11 +DEPENDS="xorg-libXtst"
    1.12 +WEB_SITE="http://www.java.com"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	mkdir -p $fs/usr/bin
    1.18 +	install -o root -g root -m755 stuff/get-java6-jdk $fs/usr/bin
    1.19 +}
    1.20 +
    1.21 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-java6-jdk/stuff/get-java6-jdk	Fri Apr 24 16:02:51 2009 +0200
     2.3 @@ -0,0 +1,106 @@
     2.4 +#!/bin/sh 
     2.5 +# Get and install the SUN Java Development Kit
     2.6 +#
     2.7 +# (C) 2007-2008 SliTaz - GNU General Public License v3.
     2.8 +# Based on get-java6-jre by Eric Joseph-Alexandre <erjo@slitaz.org>
     2.9 +# Author : KÚvin DA SILVA <dasilvakevin@hotmail.fr>
    2.10 +
    2.11 +PACKAGE="java6-jdk"
    2.12 +VERSION="1.6.0_13"
    2.13 +URL="http://raphaello.univ-fcomte.fr/ftp/java/Jdk"
    2.14 +TARBALL="jdk-6u13-linux-i586.bin"
    2.15 +TEMP_DIR="/tmp/$PACKAGE.$$"
    2.16 +ROOT="$1"
    2.17 +
    2.18 +# Check if we are root starting anything
    2.19 +if test $(id -u) != 0 ; then
    2.20 +	echo -e "\nYou must be root to run `basename $0`."
    2.21 +	echo -e "Please type 'su' and root password to become super-user.\n"
    2.22 +	exit 1
    2.23 +fi
    2.24 +
    2.25 +# Avoid reinstall
    2.26 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.27 +	echo -e "\n$PACKAGE package is already installed.\n"
    2.28 +	exit 1
    2.29 +fi
    2.30 +
    2.31 +# Check if java6-jre is installed 
    2.32 +if [ -d $ROOT/var/lib/tazpkg/installed/java6-jre ]; then
    2.33 +	echo -e "\njava6-jre must be uninstalled before install java6-jdk.\n"
    2.34 +	exit 2
    2.35 +fi
    2.36 +
    2.37 +
    2.38 +# Create TEMP_DIR
    2.39 +test -d $TEMP_DIR || mkdir $TEMP_DIR
    2.40 +cd $TEMP_DIR
    2.41 +
    2.42 +# Download the file
    2.43 +test -f $TARBALL || wget $URL/$TARBALL
    2.44 +# Do not trust 'df' free space
    2.45 +sed -i 's/exit 3$//' $TARBALL
    2.46 +
    2.47 +# Run the install file user may agree to SUN EULA
    2.48 +chmod +x  $TARBALL
    2.49 +./${TARBALL}mc
    2.50 +
    2.51 +
    2.52 +
    2.53 +# Make the package
    2.54 +mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java 
    2.55 +cp -a jdk${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
    2.56 +
    2.57 +
    2.58 +# Delete unecessary files
    2.59 +rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jdk${VERSION}/man
    2.60 +
    2.61 +# Create receipt
    2.62 +
    2.63 +cat > $PACKAGE-$VERSION/receipt <<EOT
    2.64 +# SliTaz package receipt.
    2.65 +
    2.66 +PACKAGE="$PACKAGE"
    2.67 +VERSION="$VERSION"
    2.68 +CATEGORY="non-free"
    2.69 +SHORT_DESC="SUN Java Development Kit."
    2.70 +DEPENDS="xorg-libXtst"
    2.71 +WEB_SITE="http://www.java.com/"
    2.72 +
    2.73 +post_install()
    2.74 +{
    2.75 +	echo -n "Processing post install commands..."
    2.76 +	cd /usr/lib/firefox*/plugins
    2.77 +	ln -s /usr/lib/java/jdk\$VERSION/jre/plugin/i386/ns7/libjavaplugin_oji.so
    2.78 +
    2.79 +	#lien mit dans red5 /usr/bin/javajdk
    2.80 +	cd /usr/bin
    2.81 +	ln -s /usr/lib/java/jdk\$VERSION/bin/java
    2.82 +	ln -s /usr/lib/java/jdk\$VERSION/bin/javac
    2.83 +	ln -s /usr/lib/java/jdk\$VERSION/bin/javadoc
    2.84 +	ln -s /usr/lib/java/jdk\$VERSION/bin/javap
    2.85 +	status
    2.86 +}
    2.87 +
    2.88 +post_remove()
    2.89 +{
    2.90 +	rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
    2.91 +	rm -f /usr/bin/java
    2.92 +}
    2.93 +EOT
    2.94 +
    2.95 +# Pack
    2.96 +tazpkg pack $PACKAGE-$VERSION
    2.97 +
    2.98 +# Install pseudo package
    2.99 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   2.100 +
   2.101 +# Clean
   2.102 +cd /tmp
   2.103 +rm -rf $TEMP_DIR
   2.104 +
   2.105 +
   2.106 +
   2.107 +
   2.108 +
   2.109 +