#!/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. SHIM="# " # Add enough spaces between quotes to match quotes around name on next line NAME="SDL_Perl" VERSION=2.1.3 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 export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" 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 echo "Here we go!" perl Build.PL || exit 1 ./Build || exit 1 cp -r $TMP/$NAME-$VERSION/blib/arch/auto/src/SDL* $TMP/$NAME-$VERSION/blib/arch/auto || exit 1 ./Build test ./Build install destdir=$PKG || exit 1 mv $PKG/usr/share/* $PKG/usr/ rm -rf $PKG/usr/share gzip -9 $PKG/usr/man/man3/* rm -fr $PKG/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/src find $PKG/usr/lib/perl5/site_perl/5.8.8 -type f -name .packlist -exec rm -f {} ';' find $PKG/usr/lib/perl5/site_perl/5.8.8 -type f -name '*.bs' -a -size 0 -exec rm -f {} ';' find $PKG/usr/lib/perl5/site_perl/5.8.8 -type d -depth -exec rmdir {} 2>/dev/null ';' chmod -R u+w $PKG/usr/lib/perl5/site_perl/5.8.8/* mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a COPYING BUGS CHANGELOG README TODO $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mkdir -p $PKG/install 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 (SDL Bindings for Perl) $NAME: $NAME: Many perl modules for SDL $NAME: $NAME: $NAME: $NAME: $NAME: $NAME: License: GPL 2.0 $NAME: Author: David J. Goehrig $NAME: Website: http://sdl.perl.org/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A 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"