cmt.SlackBuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/sh
  2. # Slackware build script for cmt
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. PRGNAM=cmt
  5. VERSION=${VERSION:-1.16}
  6. BUILD=${BUILD:-2}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. if [ "$ARCH" = "i486" ]; then
  20. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  21. LIBDIRSUFFIX=""
  22. elif [ "$ARCH" = "i686" ]; then
  23. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  24. LIBDIRSUFFIX=""
  25. elif [ "$ARCH" = "x86_64" ]; then
  26. SLKCFLAGS="-O2 -fPIC"
  27. LIBDIRSUFFIX="64"
  28. else
  29. SLKCFLAGS="-O2"
  30. LIBDIRSUFFIX=""
  31. fi
  32. set -e
  33. rm -rf $PKG
  34. mkdir -p $TMP $PKG $OUTPUT
  35. cd $TMP
  36. rm -rf $PRGNAM
  37. tar xvf $CWD/${PRGNAM}_src_$VERSION.tgz
  38. cd $PRGNAM
  39. chown -R root:root .
  40. find . \
  41. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  42. -exec chmod 755 {} \; -o \
  43. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  44. -exec chmod 644 {} \;
  45. chmod 644 doc/*
  46. if [ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ]; then
  47. sed -i 's/-O3/'"$SLKCFLAGS"'/' src/makefile
  48. fi
  49. # Fix glibc double-free errors when cmt's sine and ladspa_sdk's sine
  50. # both get loaded into the same ladspa host. Sent patch upstream, but
  51. # cmt is "legacy", there hasn't been a release since 2007, so not holding
  52. # my breath.
  53. patch -p1 < $CWD/fix_sine.diff
  54. make -C src
  55. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/ladspa
  56. make -C src install INSTALL_PLUGINS_DIR=$PKG/usr/lib$LIBDIRSUFFIX/ladspa
  57. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  58. cp -a README doc/* $PKG/usr/doc/$PRGNAM-$VERSION
  59. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  60. mkdir -p $PKG/install
  61. cat $CWD/slack-desc > $PKG/install/slack-desc
  62. cd $PKG
  63. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}