picospeaker.SlackBuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # Slackware build script for picospeaker
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=picospeaker
  7. VERSION=${VERSION:-0.6.2}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. ARCH=noarch
  12. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  13. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  14. exit 0
  15. fi
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. set -e
  20. rm -rf $PKG
  21. mkdir -p $TMP $PKG $OUTPUT
  22. cd $TMP
  23. rm -rf $PRGNAM-$VERSION
  24. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  25. cd $PRGNAM-$VERSION
  26. chown -R root:root .
  27. chmod 644 *
  28. chmod 755 . $PRGNAM
  29. # python3 support and short language names (de => de_DE).
  30. patch -p1 < $CWD/36273f9d_and_d6a7a01.diff
  31. # actually use python3. doesn't really matter, but someday python2 might
  32. # really go away...
  33. sed -i '1s,python,python3,' $PRGNAM
  34. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  35. mkdir -p $PKG/usr/{bin,man/man1} $PKGDOC
  36. cp -a $PRGNAM $PKG/usr/bin
  37. gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  38. mkdir -p $PKGDOC
  39. fmt -s README > $PKGDOC/README # line breaks, please.
  40. cp -a UNLICENSE $PKGDOC
  41. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  42. mkdir -p $PKG/install
  43. cat $CWD/slack-desc > $PKG/install/slack-desc
  44. cd $PKG
  45. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE