#!/bin/sh ## SlackBuild: gpsdrive ## Creator: Giacomo Rizzo < alt@free-os.it > ## Date: 14/11/2006 ## Requirements: ## #---------------- General Config EXT="alt" ARCH="i486" WGET="/usr/bin/wget -c" CWD=`pwd` #---------------- Package Config NAME="gpsdrive" VERSION="2.10pre2" BUILD="3$EXT" SOURCE="http://gpsdrive.cc/$NAME-$VERSION.tar.gz" #---------------- Defining DOCS DOCFILES="ABOUT ABOUT-NLS ANNOUNCE AUTHORS CONFIGURATION CHANGES COPYING COPYRIGHT CREDITS \ ChangeLog CHANGELOG CONTRIBUTORS *FAQ* FEATURES FILES HACKING History HISTORY \ INSTALL* LICENSE LSM MANIFEST NEWS *README* *Readme* SITES *RELEASE* RELNOTES \ THANKS TIPS TODO VERSION CONFIGURATION* GPL License Doc doc Docs* docs* Roadmap \ ROADMAP *BUGS* index.ht* *INDEX*" #---------------- Checking that user is root if [ "$UID" -ne 0 ] ; then echo "You must be root to run this script." exit 1 fi #---------------- Setting up arch, and umask ## Determin the CFLAGS based on the arch from above if [ "$ARCH" = "i386" ]; then CFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then CFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then CFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then CFLAGS="-O2" fi ## Default root umask, 0077, will bild broken packages umask 0022 #---------------- Getting Source ## Download the source if it is not present if [ -a $CWD/$NAME-$VERSION.tar.gz ]; then echo "Source for $NAME - $VERSION present not downloading" else $WGET $SOURCE || true fi ## Preparing build directory PKG="/tmp/package-$NAME" rm -rf $PKG mkdir -p $PKG ## Unpacking source code tar xvzf $CWD/$NAME-$VERSION.tar.gz cd $NAME-$VERSION ## Fixing source code permissions chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; ## Building Package if [ ! -r configure ]; then sh autogen.sh fi ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux make -j4 || return 1 make install DESTDIR=$PKG ## Moving DOCS to correct place DOCS="$PKG/usr/doc/$NAME-$VERSION" mkdir -p ${DOCS} for i in ${DOCFILES}; do if [ -e ${i} ]; then if ! [ -L ${i} ]; then cp -a ${i} ${DOCS} else cp -LRp ${i} ${DOCS} fi fi; done chmod 644 $PKG/usr/doc/$NAME-$VERSION/* chown -R root:root $PKG/usr/doc/$NAME-$VERSION/* ## Moving to package directory cd $PKG ## Strip binaries find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ## Strip libreries find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ## Fixing bin permissions for DIRECTORY in bin usr/bin usr/local/bin usr/sbin usr/X11R6/bin; do if [ -d $PKG/$DIRECTORY ]; then chmod -R 755 $PKG/$DIRECTORY fi;done ## Gzipping man pages and infopages (rm /usr/info/dir) gzip -9q $PKG/usr/man/*/* gzip -9q $PKG/usr/man/*/*/* ## Preparing /install directory mkdir -p $PKG/install # |-----handy-ruler------------------------------------------------------| cat > $PKG/install/slack-desc << END # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |----handy-ruler------------------------------------------------------| $NAME: $NAME $VERSION $NAME: $NAME: GpsDrive is a car (bike, ship, plane) navigation system. GpsDrive $NAME: displays your position provided from your NMEA capable GPS receiver $NAME: on a zoomable map, the map file is autoselected depending of the $NAME: position and prefered scale. $NAME: $NAME: Package by Giacomo Rizzo ( alt@free-os.it ) $NAME: $NAME: $NAME: END ## Building package cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-${VERSION//-/.}-$ARCH-$BUILD.tgz cp $PKG/install/slack-desc $CWD/$NAME-${VERSION//-/.}-$ARCH-$BUILD.txt ## Done