#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # homepage : http://www.reptilelabour.com/software/chromium/ # source location : http://downloads.sourceforge.net/chromium-bsu/chromium-src-0.9.12.tar.gz # dependency : liglpng,sdl,smpeg,freealut,mesa,libvorbis,openal # last revised : 12.09.2009 softname='chromium-bsu' softversion='0.9.14' packageversion='1fb' arch='i486' cpu='i686' prefix=/usr # log ;) ( # parameters needed for the build process buildir=$(pwd) src="$buildir/$softname-$softversion" srcpkg="$buildir/$softname-$softversion.tar.gz" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" source=http://ovh.dl.sourceforge.net/project/chromium-bsu/Chromium%20B.S.U.%20source%20code/0.9.14/chromium-bsu-0.9.14.tar.gz # prepare the build result directory rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/$prefix/bin mkdir -p $dest/usr/share/applications mkdir -p $dest/usr/share/$softname mkdir -p $dest/usr/share/$softname/bin mkdir -p $dest/usr/share/icons/hicolor/48x48/apps mkdir -p $dest/usr/doc # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| chromium-bsu: Chromium (Arcade game) chromium-bsu: chromium-bsu: Chromium B.S.U. is a fast paced, arcade-style, top-scrolling chromium-bsu: space shooter. chromium-bsu: chromium-bsu: You are captain of the cargo ship Chromium B.S.U., responsible chromium-bsu: for delivering supplies to our troops on the front line. Your chromium-bsu: ship has a small fleet of robotic fighters which you control from chromium-bsu: the relative safety of the Chromium vessel. chromium-bsu: chromium-bsu: EOF # check if source is present if [ -f $softname-$softversion.tar.gz ]; then echo "Source file already here, no need to download"; else echo "Downloading source" wget -c $source fi # extract the source code cd $buildir tar zxvf $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 \ ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README README.install TODO\ $dest/usr/doc/$softname-$softversion mv data/doc $dest/usr/doc/$softname-$softversion/data # strip ( 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 ) # .desktop file cat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry] Encoding=UTF-8 Name=Chromium B.S.U. Comment=2D Shooting game Exec=chromium-bsu Terminal=false Type=Application Categories=Game;ArcadeGame Icon=chromium-bsu EOF # make the package freedesktop compliant convert $src/data/png/hero.png -resize 48x48 $dest/usr/share/icons/hicolor/48x48/apps/chromium-bsu.png # SalixBuild cd $buildir cp build-$softname.sh $dest/$prefix/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 # md5sum signature cd $buildir md5sum $package.txz > $package.md5 # .dep cd $buildir echo -e "cxxlibs|gcc-g++,expat,fontconfig,freetype,ftgl,\ gcc,libX11,libXau,libXdamage,libXdmcp,libXext,libXfixes,\ libXrandr,libXrender,libXxf86vm,libdrm,libglpng,libjpeg,\ libpng,libtiff,libxcb,mesa,sdl,svgalib,zlib" > $package.dep # generate source file echo http://zenwalk.pinguix.com/user-accounts/bip/divers/salix/games/chromium/build-chromium-bsu.sh > $package.src echo $source >> $package.src # erase rm -rf $src rm -rf $dest # log ;) ) 2>&1 | tee "$softname-$softversion-build.log"