#! /bin/sh # nucleo.SlackBuild created by danix # revision: 1 # date: 10/04/2007 # source: nucleo-2007-03-07 # Setting up initial variables: CWD=`pwd` TMP=${TMP:-/tmp} APP=nucleo VERSION=20070307 SRC_VERSION=2007-03-07 ARCH=${ARCH:-i486} BUILD=1dx PKG=$TMP/package-$APP # Checking and/or downloading sources if [ ! -e "$CWD"/$APP-$SRC_VERSION.tar.bz2 ]; then wget http://insitu.lri.fr/~roussel/software/src/nucleo-2007-03-07.tar.bz2 fi # Setting up SLKCFLAGS if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86-64" ]; then SLKCFLAGS="-O2 -fPIC" fi # Extracting Sources rm -rf $PKG mkdir -p $PKG rm -rf $TMP/$APP-$VERSION cd $TMP || exit 1 tar -xjvf "$CWD"/$APP-$SRC_VERSION.tar.bz2 || exit 1 mv $APP-$SRC_VERSION $APP-$VERSION || exit 1 cd $APP-$VERSION || exit 1 chown -R root:root . chmod -R u+w,go+r-w,a-s . # making config files ./build-utils/bootstrap # Configure and compile sources CXXFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --without-vnc \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux make || exit make install DESTDIR=$PKG || exit # Install documentation mkdir -p $PKG/usr/doc/$APP-$VERSION cp -a AUTHORS ChangeLog COPYING.LESSER INSTALL LICENSE README README.cvs docs/ $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 # Final tuning mkdir -p $PKG/install if [ -e "$CWD"/slack-desc ]; then cat "$CWD"/slack-desc > $PKG/install/slack-desc fi if [ -e "$CWD"/doinst.sh ]; then cat "$CWD"/doinst.sh > $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 find . | xargs file | grep "current ar archive" | 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 ! -name "*.gz"` ; 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.tgz # doing some cleanup if [ "$1" = "--cleanup" ]; then rm -rf $PKG fi