match-vamp-plugin.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # Slackware build script for match-vamp-plugin
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20170816 bkw: switch to github homepage and download, since the site at
  6. # code.soundsoftware.ac.uk isn't responding. The tarball from github has
  7. # identical code, but a different md5sum (for one thing, it's compressed
  8. # with gzip, not bzip2), so I'm not bumping BUILD.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=match-vamp-plugin
  11. VERSION=${VERSION:-1.0}
  12. BUILD=${BUILD:-2}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. TARNAME=$( echo $PRGNAM | cut -d- -f1,2 )
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i586" ]; then
  31. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $TARNAME-$VERSION
  48. tar xvf $CWD/$TARNAME-$VERSION.tar.gz
  49. cd $TARNAME-$VERSION
  50. chown -R root:root .
  51. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  52. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  53. # 20151122 bkw: Grr. How long has this been broken?
  54. sed 's/-Wl,-Bstatic//' Makefile.linux > Makefile
  55. # Just in case someone doesn't trust upstream's default CXXFLAGS:
  56. if [ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ]; then
  57. make CXXFLAGS="$SLKCFLAGS"
  58. else
  59. make
  60. fi
  61. # No 'make install' target in Makefile.
  62. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/vamp
  63. install -s -m0755 $PRGNAM.so $PKG/usr/lib$LIBDIRSUFFIX/vamp
  64. install -m0644 $PRGNAM.cat $PKG/usr/lib$LIBDIRSUFFIX/vamp
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a README COPYING $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE