# vim: set syn=sh: # Packager: Phill Watkins pkgname=nexuiz pkgver=2.5.2 pkgrel=1pw arch=noarch source=\ ( "http://downloads.sourceforge.net/nexuiz/nexuiz-252.zip" "http://upload.wikimedia.org/wikipedia/commons/9/9c/Nexuiz_logo.svg" ) sourcetemplate=http://people.salixos.org/pwatk/packages/current/slkbuild/games/$pkgname url=http://www.alientrap.org/nexuiz options=('noextract') slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "Nexuiz (Open-source first person shooter)" "Nexuiz is a fast paced 3D deathmatch game." ) build() { set -e unzip -o $startdir/src/$pkgname-$( echo $pkgver | sed 's/\.//g' ).zip \ -x 'Nexuiz/nexuiz-osx-*' '*.exe' '*.dll' 'Nexuiz/Nexuiz-SDL.app/*' \ 'Nexuiz/Nexuiz.app/*' 'Nexuiz/extra/*' 'Nexuiz/sources/*' \ 'Nexuiz/server/*mac*' 'Nexuiz/server/*windows*' cd Nexuiz for file in nexuiz-linux*; do install -D -m 0755 $file $startdir/pkg/opt/nexuiz/$file done for dir in data havoc server; do cp -a $dir $startdir/pkg/opt/nexuiz done cat <<- EOF > $startdir/pkg/opt/nexuiz/nexuiz-launcher #!/bin/sh if [ ! -h "\$0" ]; then exit 1 fi symlink="\$(basename \$0)" cd -- "\$(dirname \$(readlink -f "\$0"))" case "\$symlink" in nexuiz-glx ) script="nexuiz-linux-glx.sh" ;; nexuiz-sdl ) script="nexuiz-linux-sdl.sh" ;; nexuiz-server ) script="server/server_linux.sh" ;; nexuiz-server-havoc ) script="server/server_havoc_linux.sh" ;; * ) exit 1 ;; esac if [ -x ./\$script ]; then ./\$script \$@ else exit 1 fi EOF chmod 755 $startdir/pkg/opt/nexuiz/nexuiz-launcher install -d $startdir/pkg/usr/games for symlink in nexuiz-{glx,sdl,server{,-havoc}} ;do ( cd $startdir/pkg/usr/games ; ln -s ../../opt/nexuiz/nexuiz-launcher $symlink ) done install -d $startdir/pkg/usr/share/applications cat <<- EOF > $startdir/pkg/usr/share/applications/nexuiz-glx.desktop [Desktop Entry] Name=Nexuiz (GLX) GenericName=First Person Shooter Comment=3D deathmatch game Exec=nexuiz-glx Icon=nexuiz Type=Application StartupNotify=true Terminal=false Categories=Game EOF cat <<- EOF > $startdir/pkg/usr/share/applications/nexuiz-sdl.desktop [Desktop Entry] Name=Nexuiz (SDL) GenericName=First Person Shooter Comment=3D deathmatch game Exec=nexuiz-sdl Icon=nexuiz Type=Application StartupNotify=true Terminal=false Categories=Game EOF chmod 644 $startdir/pkg/usr/share/applications/* 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/Nexuiz_logo.svg \ $startdir/pkg/usr/share/icons/hicolor/${icon}x${icon}/apps/nexuiz.png done install -d $startdir/pkg/usr/doc/$pkgname-$pkgver cp -a Docs/* readme.html gpl.txt $startdir/pkg/usr/doc/$pkgname-$pkgver set +e }