ut2004.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/sh
  2. # Slackware build script for ut2004
  3. # Copyright 2015 Gethyn ThomasQuail <gethyn@bloodbathsoftworks.com>
  4. # All rights reserved.
  5. #
  6. # Based on:
  7. # TeamSpeak3 SlackBuild by Willy Sudiarto Raharjo <willysr@slackbuilds.org>
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. PRGNAM=ut2004
  26. VERSION=${VERSION:-3369}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. GAMDIR=usr/share/games/ut2004
  30. if [ -z "$ARCH" ]; then
  31. case "$( uname -m )" in
  32. i?86) ARCH=i486 ;;
  33. arm*) ARCH=arm ;;
  34. *) ARCH=$( uname -m ) ;;
  35. esac
  36. fi
  37. CWD=$(pwd)
  38. TMP=${TMP:-/tmp/SBo}
  39. PKG=$TMP/package-$PRGNAM
  40. OUTPUT=${OUTPUT:-/tmp}
  41. if [ "$ARCH" = "x86_64" ]; then
  42. UARCH="amd64"
  43. else
  44. UARCH="x86"
  45. fi
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. cd $TMP
  50. mkdir -p $PKG/$GAMDIR
  51. chmod +x $CWD/"$PRGNAM"_"$VERSION"-english.midway.dvd-3.run
  52. $CWD/"$PRGNAM"_"$VERSION"-english.midway.dvd-3.run --noexec --target $PKG/$GAMDIR
  53. cd $PKG/$GAMDIR
  54. # Extract binaries based on arch
  55. tar xvf linux-$UARCH.tar.gz
  56. rsync -a System patch/
  57. # Now we can set owner and mode
  58. chown -R root:root .
  59. find -L . \
  60. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  61. -o -perm 511 \) -exec chmod 755 {} \; -o \
  62. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  63. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  64. # Move launcher script
  65. chmod +x $PKG/$GAMDIR/bin/ut2004
  66. mv $PKG/$GAMDIR/bin/ut2004 $PKG/$GAMDIR/patch/System
  67. # Clean up
  68. rm -rf $PKG/$GAMDIR/bin $PKG/$GAMDIR/vcdk-* $PKG/$GAMDIR/setup* $PKG/$GAMDIR/linux-*
  69. rsync -a patch/* $PKG/$GAMDIR
  70. rm -rf $PKG/$GAMDIR/patch
  71. # Desktop and launcher related stuff
  72. install -D -m 0644 $PRGNAM.xpm $PKG/usr/share/pixmaps/$PRGNAM.xpm
  73. install -D -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
  74. install -D -m 0755 $CWD/$PRGNAM $PKG/usr/games/$PRGNAM
  75. # Make it so the games group can access the folder
  76. chgrp -R games $PKG/$GAMDIR
  77. chmod -R 774 $PKG/$GAMDIR
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. mv EULA.txt README.liflg $PKG/usr/doc/$PRGNAM-$VERSION
  80. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  81. mkdir -p $PKG/install
  82. cat $CWD/slack-desc > $PKG/install/slack-desc
  83. cd $PKG
  84. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}