jack_delay.SlackBuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # Slackware build script for jack_delay
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=jack_delay
  7. VERSION=${VERSION:-0.4.2}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. LIBDIRSUFFIX=""
  28. elif [ "$ARCH" = "i686" ]; then
  29. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG/usr/bin $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  44. # older versions didn't have the source/ dir, this copes with either:
  45. [ -d $PRGNAM-$VERSION ] && cd $PRGNAM-$VERSION || cd $PRGNAM
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. [ -d source ] && cd source
  50. sed -i "s,-O2,$SLKCFLAGS," Makefile
  51. make
  52. make install PREFIX=$PKG/usr
  53. strip $PKG/usr/bin/*
  54. [ -e README ] || cd ..
  55. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  56. cp -a AUTHORS COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  57. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  58. mkdir -p $PKG/install
  59. cat $CWD/slack-desc > $PKG/install/slack-desc
  60. # Only add capability stuff if not disabled:
  61. if [ "${SETCAP:-yes}" = "yes" ]; then
  62. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  63. # Only allow execution by audio group
  64. chown root:audio $PKG/usr/bin/$PRGNAM
  65. chmod 0750 $PKG/usr/bin/$PRGNAM
  66. fi
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE