baudline.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/bash
  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. # 20220301 bkw: Modified by SlackBuilds.org, BUILD=3:
  21. # - actually set ARCH. makepkg was creating a package called
  22. # baudline-1.08--2_SBo.tgz, which is bad, mmm'kay?
  23. # note: .desktop file validates, but with a hint (basically a minor
  24. # warning). not going to mess with it for now.
  25. cd $(dirname $0) ; CWD=$(pwd)
  26. PRGNAM=baudline
  27. VERSION=${VERSION:-1.08}
  28. BUILD=${BUILD:-3}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. arm*) ARCH=arm ;;
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. case "$ARCH" in
  39. i?86) SRCARCH=i686; ARCHDIR=x86 ;;
  40. x86_64) SRCARCH=x86_64; ARCHDIR=x86_64 ;;
  41. *) echo "$ARCH is not supported"; exit 1 ;;
  42. esac
  43. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  44. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  45. exit 0
  46. fi
  47. TMP=${TMP:-/tmp/SBo}
  48. PKG=$TMP/package-$PRGNAM
  49. OUTPUT=${OUTPUT:-/tmp}
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf ${PRGNAM}_${VERSION}_linux_${ARCHDIR}
  55. tar -xvf $CWD/${PRGNAM}_${VERSION}_linux_${SRCARCH}.tar.gz
  56. cd ${PRGNAM}_${VERSION}_linux_${ARCHDIR}
  57. chown -R root:root .
  58. find -L . \
  59. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  60. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  61. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  62. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  63. mkdir -p $PKG/usr/bin
  64. install -m 755 baudline $PKG/usr/bin
  65. install -m 755 baudline_jack $PKG/usr/bin
  66. mkdir -p $PKG/usr/share/$PRGNAM-$VERSION/palettes
  67. cp -a palettes/* $PKG/usr/share/$PRGNAM-$VERSION/palettes
  68. mkdir -p $PKG/usr/share/$PRGNAM-$VERSION/icons
  69. cp -a icons/* $PKG/usr/share/$PRGNAM-$VERSION/icons
  70. mkdir -p $PKG/usr/share/applications/
  71. install -m 644 $CWD/baudline.desktop $PKG/usr/share/applications
  72. # Just pick an icon
  73. mkdir -p $PKG/usr/share/pixmaps
  74. install -m 644 -T icons/spectro512.png $PKG/usr/share/pixmaps/baudline.png
  75. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  76. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  77. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  78. cp -a README_unix.txt $PKG/usr/doc/$PRGNAM-$VERSION
  79. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  80. find $PKG/usr/doc -type f -exec chmod 644 {} \+
  81. mkdir -p $PKG/install
  82. cat $CWD/slack-desc > $PKG/install/slack-desc
  83. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  84. cd $PKG
  85. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE