tuxmath.SlackBuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/sh
  2. # Slackware build script for tuxmath
  3. # Written by Larry Hajali <larryhaja[at]gmail[dot]com>
  4. PRGNAM=tuxmath
  5. VERSION=${VERSION:-2.0.3}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. if [ "$ARCH" = "i486" ]; then
  20. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  21. elif [ "$ARCH" = "i686" ]; then
  22. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  23. elif [ "$ARCH" = "x86_64" ]; then
  24. SLKCFLAGS="-O2 -fPIC"
  25. fi
  26. set -e
  27. rm -rf $PKG
  28. mkdir -p $TMP $PKG $OUTPUT
  29. cd $TMP
  30. rm -rf ${PRGNAM}_w_fonts-$VERSION
  31. tar xvf $CWD/${PRGNAM}_w_fonts-$VERSION.tar.gz
  32. cd ${PRGNAM}_w_fonts-$VERSION
  33. chown -R root:root .
  34. find -L . \
  35. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  36. -exec chmod 755 {} \; -o \
  37. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  38. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  39. # Fix .desktop.
  40. sed -i -e '/^##/d' -e '/^X/d' -e 's|Math;||' $PRGNAM.desktop
  41. CFLAGS="$SLKCFLAGS" \
  42. CXXFLAGS="$SLKCFLAGS" \
  43. ./configure \
  44. --prefix=/usr \
  45. --localstatedir=/var \
  46. --docdir=/usr/doc/$PRGNAM-$VERSION \
  47. --disable-sdltest \
  48. --disable-dependency-tracking \
  49. --build=$ARCH-slackware-linux
  50. make
  51. make install DESTDIR=$PKG
  52. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  53. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  54. install -D -m 0644 $PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
  55. for i in 16 24 32 48 64 96 128; do
  56. convert data/images/icons/$PRGNAM.svg -resize ${i}x${i}! $PRGNAM-$i.png
  57. install -D -m 0644 $PRGNAM-$i.png \
  58. $PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
  59. done
  60. install -D -m 0644 data/images/icons/$PRGNAM.svg \
  61. $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg
  62. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  63. mkdir -p $PKG/install
  64. cat $CWD/slack-desc > $PKG/install/slack-desc
  65. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  66. cd $PKG
  67. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}