#!/bin/sh # Heavily based on the Slackware 13.1 SlackBuild # tilda.SlackBuild created by danix # Last build from Luca De Pandis aka atomix600 (http://www.slacky.eu) # Patch written by Ansa89 # http://www.slacky.eu # # Required: confuse # # Exit on most errors set -e # Setting up initial variables: CWD=`pwd` TMP=${TMP:-/tmp/txz} APP=tilda PKG=$TMP/package/$APP VERSION=0.9.6 ARCH=${ARCH:-i486} BUILD=1sl SOURCE=http://downloads.sourceforge.net/project/tilda/tilda/$APP-$VERSION/$APP-$VERSION.tar.gz if [ ! -e $APP-$VERSION.tar.gz ]; then wget -c $SOURCE fi # Setting up SLKCFLAGS if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" fi # Extracting Sources rm -rf $PKG mkdir -p $PKG rm -rf $TMP/$APP-$VERSION cd $TMP || exit 1 tar -zxvf "$CWD"/$APP-$VERSION.tar.gz || exit 1 # Patching sources cd $APP-$VERSION || exit 1 chown -R root:root . chmod -R u+w,go+r-w,a-s . patch -p1 -i $CWD/$APP.patch # Configure and compile sources LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --mandir=/usr/man \ --program-prefix= \ --program-suffix= \ --build=$ARCH-slackware-linux make || exit 1 make install DESTDIR=$PKG || exit 1 # Install documentation mkdir -p $PKG/usr/doc/$APP-$VERSION/SlackBuild cp -a ABOUT-NLS AUTHORS ChangeLog COPYING INSTALL NEWS README TODO /$PKG/usr/doc/$APP-$VERSION find /$PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; cat "$CWD"/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild cat "$CWD"/slack-desc > $PKG/usr/doc/$APP-$VERSION/slack-desc # Final tuning mkdir -p $PKG/install cat "$CWD"/slack-desc > $PKG/install/slack-desc if [ -e "$CWD"/doinst.sh.gz ]; then zcat "$CWD"/doinst.sh.gz > $PKG/install/doinst.sh fi ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) if [ -d $PKG/usr/man ]; then (cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz; rm $i; done ) fi if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi # Building the package cd $PKG requiredbuilder -v -y -s $CWD $PKG /sbin/makepkg -l y -c n "$CWD"/$APP-$VERSION-$ARCH-$BUILD.txz #clean up all temporary stuff if required if [ "$1" = "--cleanup" ]; then rm -rf $PKG fi