beep.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for beep
  3. # Written by gnubien contact: memo gnubien at freenode.net
  4. # This submission is considered to be in the public domain
  5. # Modified by Robby Workman of the SlackBuilds.org project
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=beep
  8. VERSION=${VERSION:-1.3}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. fi
  36. # See the manpage for more information on why, but you will need to install
  37. # beep with the suid bit set in order to have full functionality in all
  38. # instances. The default is NO, but it *should* be safe to change it to YES
  39. SET_SUID=NO
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP || exit 1
  43. rm -rf $PRGNAM-$VERSION
  44. tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
  45. cd $PRGNAM-$VERSION || exit 1
  46. chown -R root:root .
  47. find -L . \
  48. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  49. -o -perm 511 \) -exec chmod 755 {} \; -o \
  50. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  51. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  52. # NO configure file for beep
  53. # We're going to install the beep executable into /bin instead of /usr/bin
  54. # This way, init scripts can use it if you happen to want to customize them
  55. # with some troubleshooting tones. Thanks to Erik van Tromp (alphageek) for
  56. # the suggestion.
  57. mkdir -p $PKG/bin $PKG/usr/man/man1 || exit 1
  58. make || exit
  59. strip --strip-unneeded beep
  60. if [ "$SET_SUID" = "YES" ]; then
  61. install -m 4755 beep $PKG/bin
  62. else
  63. install -m 0755 beep $PKG/bin
  64. fi
  65. install -m 0644 beep.1.gz $PKG/usr/man/man1
  66. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  67. cp -a CHANGELOG COPYING CREDITS INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cd $PKG
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE