#! /bin/sh # Heavily based on the Slackware 13.0 SlackBuild # tilda.SlackBuild created by danix # http://www.slacky.eu # # Required confuse # # Setting up initial variables: CWD=`pwd` TMP=${TMP:-/tmp/txz} APP=tilda PKG=$TMP/package/$APP VERSION=0.9.6 ARCH=${ARCH:-i486} BUILD=5dx 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 cd $APP-$VERSION || exit 1 chown -R root:root . chmod -R u+w,go+r-w,a-s . # 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/SlackBuild/$APP.SlackBuild cat "$CWD"/slack-desc > $PKG/usr/doc/$APP-$VERSION/SlackBuild/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 strip --strip unneeded 2> /dev/null find . | xargs file | grep "shared objects" | grep ELF | cut -f 1 -d : | xargs strip --strip unneeded 2> /dev/null ) 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 echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache -f -q /usr/share/icons/hicolor &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh # 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