#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. NAME="physfs" VERSION=1.1.1 ARCH=i586 BUILD=2vl59 VL_PACKAGER=exeterdad CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME-$VERSION #tar xjvf $CWD/$NAME-$VERSION.tar.bz2 || exit 1 tar zxvf $CWD/$NAME-$VERSION.tar.gz || exit 1 cd $TMP/$NAME-$VERSION cmake . || exit 1 sed -i 's|CMAKE_INSTALL_PREFIX:PATH=/usr/local|CMAKE_INSTALL_PREFIX:PATH=/usr|g' CMakeCache.txt echo "building...." make || exit 1 echo "making doxy...." doxygen || exit 1 echo "installing now...." make DESTDIR=$PKG CMAKE_INSTALL_PREFIX=/usr install || exit 1 mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a CHANGELOG.txt CREDITS.txt INSTALL.txt LICENSE.txt TODO.txt $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mkdir -p $PKG/usr/man/man3 cp docs/man/man3/*.3 $PKG/usr/man/man3/ find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/install # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "$NAME"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/slack-desc << EOF # 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 ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: $NAME (file abstraction layer for games) $NAME: $NAME: PhysicsFS is a library to provide abstract access to various $NAME: archives. It is intended for use in video games, and the design $NAME: was somewhat inspired by Quake 3's file subsystem. The programmer $NAME: defines a "write directory" on the physical filesystem. No file $NAME: writing done through the PhysicsFS API can leave that write $NAME: directory, for security. $NAME: License: zlib License $NAME: Author: Ryan C. Gordon and many contributers. $NAME: Website: http://www.icculus.org/physfs/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" $TMP/$NAME-$VERSION/config.log` EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " 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 echo "Finding dependancies..." requiredbuilder -v -y -s $RELEASEDIR $PKG echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." #rm -rf $TMP echo "Done"