love.SlackBuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Slackware build script for LÖVE
  3. # Written by Dugan Chen (thedoogster [at] gmail [dot] com)
  4. # Now maintained by B. Watson <urchlay@slackware.uk>.
  5. # Original version had no license; modified version licensed under the
  6. # WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  7. # 20220611 bkw: update for v11.4.
  8. # 20210902 bkw: BUILD=2, get rid of .la file
  9. # 20200415 bkw:
  10. # - take over maintenance
  11. # - update for v11.3
  12. cd $(dirname $0) ; CWD=$(pwd)
  13. PRGNAM=love
  14. VERSION=${VERSION:-11.4}
  15. BUILD=${BUILD:-1}
  16. TAG=${TAG:-_SBo}
  17. PKGTYPE=${PKGTYPE:-tgz}
  18. if [ -z "$ARCH" ]; then
  19. case "$( uname -m )" in
  20. i?86) ARCH=i586 ;;
  21. arm*) ARCH=arm ;;
  22. *) ARCH=$( uname -m ) ;;
  23. esac
  24. fi
  25. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  26. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  27. exit 0
  28. fi
  29. TMP=${TMP:-/tmp/SBo}
  30. PKG=$TMP/package-$PRGNAM
  31. OUTPUT=${OUTPUT:-/tmp}
  32. if [ "$ARCH" = "i586" ]; then
  33. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "x86_64" ]; then
  39. SLKCFLAGS="-O2 -fPIC"
  40. LIBDIRSUFFIX="64"
  41. else
  42. SLKCFLAGS="-O2"
  43. LIBDIRSUFFIX=""
  44. fi
  45. set -e
  46. rm -rf $PKG
  47. mkdir -p $TMP $PKG $OUTPUT
  48. cd $TMP
  49. rm -rf $PRGNAM-$VERSION
  50. tar xvf $CWD/$PRGNAM-$VERSION-linux-src.tar.gz
  51. cd $PRGNAM-$VERSION
  52. chown -R root:root .
  53. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  54. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  55. CFLAGS="$SLKCFLAGS" \
  56. CXXFLAGS="$SLKCFLAGS" \
  57. ./configure \
  58. --prefix=/usr \
  59. --libdir=/usr/lib${LIBDIRSUFFIX} \
  60. --sysconfdir=/etc \
  61. --localstatedir=/var \
  62. --mandir=/usr/man \
  63. --docdir=/usr/doc/$PRGNAM-$VERSION \
  64. --enable-static=no \
  65. --build=$ARCH-slackware-linux
  66. make
  67. make install-strip DESTDIR=$PKG
  68. gzip $PKG/usr/man/man1/$PRGNAM.1
  69. rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.la
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a changes.txt license.txt readme.md $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE