#!/bin/bash # # teamspeak-client.SlackBuild # code: Vicious (michal@scxd.info); improvements: Zielony (e-pl@o2.pl) set -e # PACKAGE GENERAL INFO [EDIT] PKGNAME=teamspeak-client VERSION=2.0.32 BUILD=1X ARCH=noarch URL=ftp://ftp.freenet.de/pub/4players/teamspeak.org/releases/ts2_client_rc2_"`echo $VERSION | tr -d .`".tar.bz2 CWD=`pwd` TMP=/tmp/$PKGNAME if [ ! -d $TMP/$PKGNAME-$VERSION ]; then rm -rf $TMP/package mkdir -p $TMP/package/install $TMP/package/usr/share/ts-client $TMP/usr/bin # PACKAGE DESCRIPTION [EDIT] cat << SLACKDESC | fmt -w $(( 80 - `echo $PKGNAME | wc -c` - 3 )) | perl -pe "s/^/$PKGNAME: /" > $TMP/package/install/slack-desc TeamSpeak Client (communication system client) TeamSpeak is a quality, scalable application which enables people to speak with one another over the Internet. TeamSpeak consists of both client and server software. The server acts as a host to multiple client connections, capable of handling literally thousands of simultaneous users. This results in an Internet based teleconferencing solution that works in a variety of applications such as team mates speaking with one another while playing their favorite online game, small businesses cutting costs on long distance charges, or for personal communication with friends and family. Package prepared by Zielony (e-pl@o2.pl) SLACKDESC cd $TMP # step 1: DOWNLOAD SOURCE PKGFNAME=`ls -t | grep -i $PKGNAME*.t*z* | head -1` if [ -z $PKGFNAME ]; then ( wget -c $URL -P $TMP -O $PKGNAME-$VERSION.${URL//*.} ) # step 2: UNPACK SOURCE AND COMPILE PKGFNAME=`ls -t | grep -i $PKGNAME*.t*z* | head -1` fi EXTENSION=`echo ${PKGFNAME//*.}` if [ $EXTENSION = "bz2" ]; then tar jxvf $PKGFNAME -C $TMP else tar xvfz $PKGFNAME -C $TMP fi DIRNAME=`tar tf $PKGFNAME | head -1` echo $DIRNAME | grep '/' && DIRNAME=${DIRNAME%${DIRNAME#*/}} if [ $DIRNAME != $PKGNAME-$VERSION/ ]; then mv $DIRNAME $PKGNAME-$VERSION; fi chown root:root $TMP -R fi cd $TMP/$PKGNAME-$VERSION/setup.data/image sed -i 's@%installdir%@/usr/share/ts-client@g' TeamSpeak mv TeamSpeak $TMP/package/usr/bin/ts-client cp -a * $TMP/package/usr/share/ts-client # step 3: STRIP BINARIES & GZIP MANUALS ( cd $TMP/package find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) ( gzip $TMP/package/usr/man/man?/* ) # step 4: CREATE PACKAGE & CLEAN TMP cd $TMP/package if [ `ls | wc -m` -le 8 ]; then echo "Brak plików pakietu!" else ( requiredbuilder -y -s $TMP/package/install $TMP/$PKGNAME-$VERSION ) makepkg -l y -c n $CWD/$PKGNAME-$VERSION-$ARCH-$BUILD.tgz #rm -rf $TMP fi