# vim: set syn=sh: # Packager: Phill Watkins pkgname=UrbanTerror pkgver=4.1.1 pkgrel=1pw arch=noarch source=\ ( "http://www.iourt.com/files/UrbanTerror$( echo $pkgver | sed 's/\.//g' ).zip" "http://www0.org/urt/ioq3-1807-urt-251210-linux32.tar.bz2" "http://www0.org/urt/ioq3-1807-urt-251210-linux64.tar.bz2" "http://www.1gfx.com/apd/UrbanTerrorIcon.zip" ) sourcetemplate=http://people.salixos.org/pwatk/packages/slkbuild/$pkgname docs=('FILES.txt' 'ioUrbanTerror_*.txt' 'Licences.txt' 'readme41.txt') url=http://www.urbanterror.info options=('noextract') slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "UrbanTerror (Free multiplayer first person shooter)" "Urban Terror can be described as a Hollywood tactical shooter;" "somewhat realism based, but the motto is \"fun over realism\". This" "results in a very unique, enjoyable and addictive game." "" "This package includes an optimised executable with the \"latest" "version of ioq3 engine, optimized and enriched with several new" "features and fixes.\"" ) build() { set -e unzip -o $startdir/src/$pkgname$( echo $pkgver | sed 's/\.//g' ).zip \ -x '*.exe' '*.reg' '*.ico' '*.url' '*.doc' 'UrbanTerror/ioUrbanTerror.app/*' cd $pkgname tar xvf $startdir/src/ioq3-1807-urt-251210-linux32.tar.bz2 mv ioq3-urt{,.i386} tar xvf $startdir/src/ioq3-1807-urt-251210-linux64.tar.bz2 ioq3-urt mv ioq3-urt{,.x86_64} for file in ioq3-urt.{i386,x86_64} ioUrbanTerror.{i386,x86_64} ioUrTded.{i386,x86_64}; do install -Dm 0755 $file $startdir/pkg/opt/UrbanTerror/$file done cp -a q3ut4 $startdir/pkg/opt/UrbanTerror rm -f $startdir/pkg/opt/UrbanTerror/q3ut4/readme41.txt cat <<- EOF > $startdir/pkg/opt/UrbanTerror/urt-launcher #!/bin/sh if [ ! -h "\$0" ]; then exit 1 fi if [ "\$(uname -m)" = "x86_64" ]; then arch="x86_64" else arch="i386" fi symlink="\$(basename \$0)" cd -- "\$(dirname \$(readlink -f "\$0"))" if [ -x ./\$symlink.\$arch ]; then ./\$symlink.\$arch \$@ else exit 1 fi EOF chmod 755 $startdir/pkg/opt/UrbanTerror/urt-launcher install -d $startdir/pkg/usr/games for symlink in ioq3-urt ioUrbanTerror ioUrTded; do ( cd $startdir/pkg/usr/games ; ln -s ../../opt/UrbanTerror/urt-launcher $symlink ) done install -d $startdir/pkg/usr/share/applications cat <<- EOF > $startdir/pkg/usr/share/applications/ioq3-urt.desktop [Desktop Entry] Name=Urban Terror (Optimised) GenericName=First Person Shooter Comment=Hollywood tactical shooter Exec=ioq3-urt Icon=UrbanTerror Type=Application StartupNotify=true Terminal=false Categories=Game EOF cat <<- EOF > $startdir/pkg/usr/share/applications/ioUrbanTerror.desktop [Desktop Entry] Name=Urban Terror GenericName=First Person Shooter Comment=Hollywood tactical shooter Exec=ioUrbanTerror Icon=UrbanTerror Type=Application StartupNotify=true Terminal=false Categories=Game EOF chmod 644 $startdir/pkg/usr/share/applications/* unzip -o $startdir/src/UrbanTerrorIcon.zip -d $startdir/src for icon in 16 22 24 32 48 ;do install -d $startdir/pkg/usr/share/icons/hicolor/${icon}x${icon}/apps convert -resize ${icon}x${icon} $startdir/src/UrbanTerrorIcon.png \ $startdir/pkg/usr/share/icons/hicolor/${icon}x${icon}/apps/UrbanTerror.png done set +e }