#!/bin/sh # Built on TCL v3.3 # Required extensions: # squashfs-tools-4.x # tar getTime.sh installExtension() { if [ ! -e /usr/local/tce.installed/$1 ]; then echo "Installing "$1" ..." if [ -e $TCEDIR/optional/$1.tcz ]; then tce-load -i $1 else tce-load -wi $1 fi [ ! -e /usr/local/tce.installed/$1 ] && echo "Error: Extension "$1" not installed! Aborting" && exit fi } # Install these extensions automagically export EXTS="squashfs-tools-4.x tar" export TCEDIR=`cat /opt/.tce_dir` export EXTNAME="Cg" export VER="-3.0_November2010_x86" export DESTDIR=`pwd`/$EXTNAME export PKGNAME=$EXTNAME$VER for f in $EXTS; do installExtension $f done mkdir -p $DESTDIR/usr/local/share/doc/License cd $DESTDIR #unpack source if [ -e ../$PKGNAME.tar.bz2 ]; then tar -jxf ../$PKGNAME.tar.bz2 elif [ -e ../$PKGNAME.tb2 ]; then tar -jxf ../$PKGNAME.tb2 elif [ -e ../$PKGNAME.tbz ]; then tar -jxf ../$PKGNAME.tbz elif [ -e ../$PKGNAME.tar.gz ]; then tar -zxf ../$PKGNAME.tar.gz elif [ -e ../$PKGNAME.tgz ]; then tar -zxf ../$PKGNAME.tgz elif [ -e ../$PKGNAME.tar.xz ]; then tar -Jxf ../$PKGNAME.tar.xz elif [ -e ../$PKGNAME.txz ]; then tar -Jxf ../$PKGNAME.txz elif [ -e ../$PKGNAME.tar.lzma ]; then tar -xf ../$PKGNAME.tar.lzma --lzma elif [ -e ../$PKGNAME.tlz ]; then tar -xf ../$PKGNAME.tlz --lzma else echo "Source tarball not found! Aborting" && exit fi mv usr/include usr/local mv usr/bin usr/local mv usr/share/* usr/local/share mv usr/lib usr/local rm -rf usr/share cp usr/local/$EXTNAME/docs/license.txt usr/local/share/doc/License/$EXTNAME.txt find usr -not -type d > ../$EXTNAME.tcz.list cd .. mksquashfs $EXTNAME $EXTNAME.tcz -noappend md5sum $EXTNAME.tcz > $EXTNAME.tcz.md5.txt rm -rf $EXTNAME