#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # homepage : http://sourceforge.net/projects/ftgl/develop # source location : # last revised : 12.9.2009 # dep : softname='ftgl' softversion='2.1.3-rc5' softversionsrc='2.1.3~rc5' softversionpkg='2.1.3_rc5' packageversion='1fb' arch='i486' cpu='i686' # log ;) ( # parameters needed for the build process buildir=$(pwd) srcpkg="$buildir/$softname-$softversion.tar.bz2" src="$buildir/$softname-$softversionsrc" package="$softname-$softversionpkg-$arch-$packageversion" dest="$buildir/$package" source=http://ovh.dl.sourceforge.net/project/ftgl/FTGL%20Source/2.1.3%7Erc5/$softname-$softversion.tar.bz2 # prepare the build result directory dest="$buildir/$package" rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/usr/src/$softname-$softversion # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| ftgl: ftgl (C++ library that uses Freetype2) ftgl: ftgl: FTGL is a free cross-platform Open Source C++ library that uses ftgl: Freetype2 to simplify rendering fonts in OpenGL applications. ftgl: FTGL supports bitmaps, pixmaps, texture maps, outlines, polygon mesh, ftgl: and extruded polygon rendering modes. ftgl: ftgl: ftgl: ftgl: ftgl: EOF # check if source is present if [ -f $softname-$softversion.bz2 ]; then echo "Source file already here, no need to download"; else echo "Downloading source" wget -c --no-check-certificate $source fi # extract the source code cd $buildir tar xvf $srcpkg cd $src # build export CFLAGS="-O2 -march=$arch -mtune=$cpu" export CXXFLAGS="-O2 -march=$arch -mtune=$cpu" ./configure \ --prefix=/usr \ --enable-static=no \ --program-prefix="" \ --program-suffix="" \ --mandir=/usr/man \ --build=$arch-slackware-linux make make install DESTDIR=$dest # add 'default' files mkdir -p $dest/usr/doc/$softname-$softversion cp -a \ AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO\ $dest/usr/doc/$softname-$softversion cp $dest/usr/share/doc/ftgl/*.txt $dest/usr/doc/$softname-$softversion rm -rf $dest/usr/share/doc/ # strip executables ( cd $dest 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 ) # compress man pages ( cd $dest/usr/man find . -name "*.?" | xargs gzip -9 ) # SalixBuild cp $buildir/build-$softname.sh $dest/usr/src/$softname-$softversion # set target permissions chown -R root:root $dest cd $dest 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 {} \; # real packaging work: cd $dest makepkg -l y -c n $dest.txz # computes the md5sum signature for the package cd $buildir md5sum $package.txz > $package.md5 # .dep cd $buildir echo -e "cxxlibs,gcc-g++,freetype,gcc,libX11,libXau,libXdamage,\ libXdmcp,libXext,libXfixes,libXxf86vm,libdrm,libxcb,mesa,zlib" > $package.dep # src file echo http://zenwalk.pinguix.com/user-accounts/bip/divers/salix/l/ftgl/build-ftgl.sh > $package.src echo $source >> $package.src # erase rm -rf $src rm -rf $dest # log ;) ) 2>&1 | tee "$softname-$softversion-build.log"