brickout.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Slackware build script for brickout
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Modified by the SlackBuilds.org project
  5. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  6. # 20141030 bkw: make VERSION a fixed value, derive SRCVER from it (instead of
  7. # the other way around). Nitpick.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=brickout
  10. VERSION=${VERSION:-20020609}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. SRCVER=$( echo $VERSION | sed 's,\(....\)\(..\)\(..\),\1.\2.\3,' )
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i586 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. fi
  36. set -e
  37. rm -rf $PKG
  38. mkdir -p $TMP $PKG $OUTPUT
  39. cd $TMP
  40. rm -rf $PRGNAM-$SRCVER
  41. tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
  42. cd $PRGNAM-$SRCVER
  43. chown -R root:root .
  44. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  45. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  46. # This is fugly. Apologies.
  47. make \
  48. TARGET=$PRGNAM.sdl $PRGNAM.sdl \
  49. PROGPREFIX= \
  50. XLIB="$(sdl-config --libs) -lSDL_mixer" \
  51. LIBDIR= \
  52. EXTRA_CFLAGS="$SLKCFLAGS -DUSE_SDL $(sdl-config --cflags)" \
  53. IMAGEDIR=/usr/share/$PRGNAM/images/ \
  54. SOUNDDIR=/usr/share/$PRGNAM/sounds/ \
  55. MUSICDIR=/usr/share/$PRGNAM/music/ \
  56. THE_IMAGES=
  57. # No 'make install' target in Makefile, do it ourselves.
  58. mkdir -p $PKG/usr/games
  59. install -m0755 -oroot -groot $PRGNAM.sdl $PKG/usr/games/$PRGNAM
  60. mkdir -p $PKG/usr/share/$PRGNAM
  61. cp -r images-sdl $PKG/usr/share/$PRGNAM/images
  62. cp -r sounds $PKG/usr/share/$PRGNAM/sounds
  63. cp -r music $PKG/usr/share/$PRGNAM/music
  64. find $PKG/usr/share/$PRGNAM -type d | xargs chmod 0755
  65. find $PKG/usr/share/$PRGNAM -type f | xargs chmod 0644
  66. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  67. cp *.txt $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/usr/man/man6
  70. gzip -9c $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
  71. mkdir -p $PKG/usr/share/pixmaps
  72. cp $PRGNAM.png $PKG/usr/share/pixmaps
  73. mkdir -p $PKG/usr/share/applications
  74. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE