whistle.SlackBuild 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # Slackbuild for whistle
  3. # Written by Manuel Fill <manuel.fill.42@gmail.com>
  4. # Slackbuild is released under the Dog-on-Fire License:
  5. # If use of this script causes your dog to catch on fire,
  6. # you agree to send me five dollars. Or a picture
  7. # of the dog on fire.
  8. # Otherwise, you're on your own. I've tested the script
  9. # on my own computer, and it hasn't broken anything.
  10. # So if it does it on your computer, that falls in
  11. # the realm of "Not my problem."
  12. #
  13. # Of course, if you'll send a bug report to the above
  14. # email address, I may be able to see what you did
  15. # wrong and prevent it from happening in the future.
  16. # In which case, I may just send YOU five dollars.
  17. # Oh, and feel free to copy it and modify it as you
  18. # see fit. Or as I see fit. Or as I fit. Although
  19. # that is unlikely, as I am rather tall.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=whistle
  22. VERSION=${VERSION:-0.9.3}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. if [ "$ARCH" = "i586" ]; then
  44. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  45. LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "i686" ]; then
  47. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. SLKCFLAGS="-O2 -fPIC"
  51. LIBDIRSUFFIX="64"
  52. fi
  53. set -e
  54. rm -rf $PKG
  55. mkdir -p $TMP $PKG $OUTPUT
  56. cd $TMP
  57. rm -rf $PRGNAM-$VERSION
  58. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz
  59. cd $PRGNAM-$VERSION
  60. chown -R root:root .
  61. find -L . \
  62. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  63. -o -perm 511 \) -exec chmod 755 {} \; -o \
  64. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  65. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  66. mkdir -p $PKG/usr/bin
  67. cp whistle $PKG/usr/bin/whistle
  68. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  69. cp -a AUTHORS LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
  70. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  71. mkdir -p $PKG/install
  72. cat $CWD/slack-desc > $PKG/install/slack-desc
  73. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  74. cd $PKG
  75. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE