espeakup.SlackBuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # Slackware build script for espeakup
  3. # Written by albator albat0r78@wanadoo.fr
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=espeakup
  6. VERSION=${VERSION:-0.71}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  18. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  19. exit 0
  20. fi
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. if [ "$ARCH" = "i586" ]; then
  25. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "x86_64" ]; then
  31. SLKCFLAGS="-O2 -fPIC"
  32. LIBDIRSUFFIX="64"
  33. else
  34. SLKCFLAGS="-O2"
  35. LIBDIRSUFFIX=""
  36. fi
  37. set -e
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $PRGNAM-$VERSION
  42. if [ -e $CWD/v$VERSION.tar.gz ]; then
  43. tar xvf $CWD/v$VERSION.tar.gz
  44. else
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. fi
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  51. -o -perm 511 \) -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  53. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  54. # 20211209 bkw: Slackware now ships espeak-ng, use it.
  55. sed -i 's,-lespeak,&-ng,' Makefile
  56. make MANDIR=/usr/man/man8 CFLAGS="$SLKCFLAGS"
  57. make install MANDIR=/usr/man/man8 DESTDIR=$PKG
  58. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  59. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  60. find $PKG/usr/man -type f -exec gzip -9 {} \;
  61. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  62. mkdir -p $PKG/install
  63. cat $CWD/slack-desc > $PKG/install/slack-desc
  64. cd $PKG
  65. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE