#!/bin/sh # Built on TCL v3.8.2 # Required extensions: # compiletc # binutils # base-dev # bison # diffutils # file # findutils # flex # gawk # gcc # gcc_libs # cloog # ppl # gmp # mpfr # gperf # grep # m4 # make # patch # pkg-config # sed # 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 } createExtension() { mksquashfs $1 $1.tcz -noappend [ ! -e $1.tcz ] && echo "Error: "$1".tcz not created! Aborting" && exit } unpackSrc() { #unpack source if [ -e $1.tar.bz2 ]; then tar -jxf $1.tar.bz2 elif [ -e $1.tb2 ]; then tar -jxf $1.tb2 elif [ -e $1.tbz ]; then tar -jxf $1.tbz elif [ -e $1.tar.gz ]; then tar -zxf $1.tar.gz elif [ -e $1.tgz ]; then tar -zxf $1.tgz elif [ -e $1.tar.xz ]; then tar -Jxf $1.tar.xz elif [ -e $1.txz ]; then tar -Jxf $1.txz elif [ -e $1.tar.lzma ]; then tar -xf $1.tar.lzma --xz elif [ -e $1.tlz ]; then tar -xf $1.tlz --xz else echo "Source "$1" not found! Aborting" && exit fi } # Install these extensions automagically export EXTS="compiletc squashfs-tools-4.x tar" export TCEDIR=`cat /opt/.tce_dir` export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export EXTNAME="tzdata" export VERC="2011i" export VERD="2011n" export DESTDIR=`pwd`/$EXTNAME export PKGNAME="../$EXTNAME$VERD" export PKGNAMEC="../tzcode$VERC" for f in $EXTS; do installExtension $f done mkdir -p temp $EXTNAME/usr/local $EXTNAME/usr/local/tce.installed cd temp unpackSrc $PKGNAME unpackSrc $PKGNAMEC make TZDIR=$DESTDIR/usr/local/share/zoneinfo ETCDIR=$DESTDIR/usr/local/bin LIBDIR=$DESTDIR/usr/local/lib install cd $DESTDIR sudo strip --strip-unneeded usr/local/bin/* sudo strip -g usr/local/lib/* sudo sed -i 's!/ksh!/bash!' usr/local/bin/tzselect sudo sed -i 's!nawk!awk!' usr/local/bin/tzselect sudo sed -i 's!'$DESTDIR'!!' usr/local/bin/tzselect echo "#! /bin/sh ln -s /usr/local/share/zoneinfo /usr/share/zoneinfo ln -s /usr/local/share/zoneinfo-leaps /usr/share/zoneinfo-leaps ln -s /usr/local/share/zoneinfo-posix /usr/share/zoneinfo-posix" > usr/local/tce.installed/$EXTNAME chown root:staff -R usr/local/tce.installed chmod 775 -R usr/local/tce.installed cd .. createExtension $EXTNAME rm -rf $EXTNAME temp # Create extension support files and test installExtension "submitqc" submitqc