gottet.SlackBuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. # Slackware build script for gottet
  3. # Originally written by:
  4. # Ryan P.C. McQuen | Everett, WA | email removed
  5. # Now maintained by B. Watson (yalhcru@gmail.com)
  6. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  7. # 20211008 bkw:
  8. # - relicensed with permission from Ryan.
  9. # - update for v1.2.0. qt5 now in Slackware...
  10. # 20170309 bkw:
  11. # - take over maintenance
  12. # - thought about a version bump, but 1.0.6 is the last version that
  13. # supports qt4. don't want qt5 as a dep.
  14. # - binary in /usr/games
  15. # - i486 => i586
  16. # - support SLKCFLAGS
  17. # - BUILD=2
  18. cd $(dirname $0) ; CWD=$(pwd)
  19. PRGNAM=gottet
  20. VERSION=${VERSION:-1.2.0}
  21. BUILD=${BUILD:-1}
  22. TAG=${TAG:-_SBo}
  23. PKGTYPE=${PKGTYPE:-tgz}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -eu
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM-$VERSION
  56. tar xvf $CWD/$PRGNAM-$VERSION-src.tar.bz2
  57. cd $PRGNAM-$VERSION
  58. chown -R root:root .
  59. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  60. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  61. # 20211008 bkw: upstream now includes a man page, put it in the right place.
  62. sed -i 's,share/man,man,' $PRGNAM.pro
  63. qmake-qt5 PREFIX=/usr BINDIR=games
  64. sed -i "s,-O2,$SLKCFLAGS," Makefile
  65. make
  66. make install INSTALL_ROOT=$PKG
  67. strip $PKG/usr/games/$PRGNAM
  68. gzip $PKG/usr/man/man*/*.*
  69. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  70. cp -a COPYING ChangeLog CREDITS $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mkdir -p $PKG/install
  73. cat $CWD/slack-desc > $PKG/install/slack-desc
  74. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE