baudline.SlackBuild 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/sh
  2. # Slackbuild for baudline
  3. # Written by JK Wood <joshuakwood@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. PRGNAM=baudline
  21. VERSION=${VERSION:-1.08}
  22. BUILD=${BUILD:-2}
  23. TAG=${TAG:-_SBo}
  24. case "${ARCH:-$(uname -m)}" in
  25. i?86) SRCARCH=i686; ARCHDIR=x86 ;;
  26. x86_64) SRCARCH=x86_64; ARCHDIR=x86_64 ;;
  27. *) echo "$ARCH is not supported"; exit 1 ;;
  28. esac
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. set -e
  34. rm -rf $PKG
  35. mkdir -p $TMP $PKG $OUTPUT
  36. cd $TMP
  37. rm -rf ${PRGNAM}_${VERSION}_linux_${ARCHDIR}
  38. tar -xvf $CWD/${PRGNAM}_${VERSION}_linux_${SRCARCH}.tar.gz
  39. cd ${PRGNAM}_${VERSION}_linux_${ARCHDIR}
  40. chown -R root:root .
  41. find -L . \
  42. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  43. -o -perm 511 \) -exec chmod 755 {} \; -o \
  44. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  45. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  46. mkdir -p $PKG/usr/bin
  47. install -m 755 baudline $PKG/usr/bin
  48. install -m 755 baudline_jack $PKG/usr/bin
  49. mkdir -p $PKG/usr/share/$PRGNAM-$VERSION/palettes
  50. cp -a palettes/* $PKG/usr/share/$PRGNAM-$VERSION/palettes
  51. mkdir -p $PKG/usr/share/$PRGNAM-$VERSION/icons
  52. cp -a icons/* $PKG/usr/share/$PRGNAM-$VERSION/icons
  53. mkdir -p $PKG/usr/share/applications/
  54. install -m 644 $CWD/baudline.desktop $PKG/usr/share/applications
  55. # Just pick an icon
  56. mkdir -p $PKG/usr/share/pixmaps
  57. install -m 644 -T icons/spectro512.png $PKG/usr/share/pixmaps/baudline.png
  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. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  61. cp -a README_unix.txt $PKG/usr/doc/$PRGNAM-$VERSION
  62. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  63. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}