jackmeter.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Slackware build script for jackmeter
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=jackmeter
  7. VERSION=${VERSION:-0.4}
  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 $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  44. cd $PRGNAM-$VERSION
  45. chown -R root:root .
  46. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  47. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  48. # 20170716 bkw: github download needs this
  49. autoreconf -ifv
  50. # minor markup errors, plus document the default value for -r option
  51. patch -p1 < $CWD/fix_manpage.diff
  52. CFLAGS="$SLKCFLAGS" \
  53. CXXFLAGS="$SLKCFLAGS" \
  54. ./configure \
  55. --prefix=/usr \
  56. --libdir=/usr/lib${LIBDIRSUFFIX} \
  57. --sysconfdir=/etc \
  58. --localstatedir=/var \
  59. --mandir=/usr/man \
  60. --docdir=/usr/doc/$PRGNAM-$VERSION \
  61. --build=$ARCH-slackware-linux
  62. make
  63. make install-strip DESTDIR=$PKG
  64. find $PKG/usr/man -type f -exec gzip -9 {} \;
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a \
  67. AUTHORS COPYING NEWS README TODO \
  68. $PKG/usr/doc/$PRGNAM-$VERSION
  69. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  70. mkdir -p $PKG/install
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  73. # Only add capability stuff if not disabled:
  74. if [ "${SETCAP:-yes}" = "yes" ]; then
  75. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  76. # Only allow execution by audio group
  77. chown root:audio $PKG/usr/bin/jack_meter
  78. chmod 0750 $PKG/usr/bin/jack_meter
  79. fi
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE