pd_mrpeach.SlackBuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh
  2. # Slackware build script for <pd-mrpeach>
  3. #
  4. # Copyright 2011 Michales - clavisound - Michaloudes korgie@gmail.com
  5. PRGNAM=pd_mrpeach
  6. VERSION=${VERSION:-2011.10.21}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. *) ARCH=$( uname -m ) ;;
  14. esac
  15. fi
  16. CWD=$(pwd)
  17. TMP=${TMP:-/tmp/SBo}
  18. PKG=$TMP/package-$PRGNAM
  19. OUTPUT=${OUTPUT:-/tmp}
  20. if [ "$ARCH" = "i486" ]; then
  21. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  22. LIBDIRSUFFIX=""
  23. elif [ "$ARCH" = "i686" ]; then
  24. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  25. LIBDIRSUFFIX=""
  26. elif [ "$ARCH" = "x86_64" ]; then
  27. SLKCFLAGS="-O2 -fPIC"
  28. LIBDIRSUFFIX="64"
  29. else
  30. SLKCFLAGS="-O2"
  31. LIBDIRSUFFIX=""
  32. fi
  33. set -e
  34. rm -rf $PKG
  35. mkdir -p $TMP $PKG $OUTPUT
  36. cd $TMP
  37. rm -rf $PRGNAM-$VERSION
  38. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  39. mv mrpeach $PRGNAM-$VERSION
  40. cd $PRGNAM-$VERSION
  41. chown -R root:root .
  42. find . \
  43. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  44. -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  46. -exec chmod 644 {} \;
  47. ALL=${ALL:-NO}
  48. OBJECTS="osc/*.c net/*.c"
  49. [ $ALL = "NO" ] || OBJECTS="*/*.c"
  50. # procedure from http://mag-one.noblogs.org/xmix/startup-guide/osc-objects-guide/
  51. for object in $OBJECTS ; do
  52. gcc \
  53. $SLKCFLAGS \
  54. -I/usr/include \
  55. -shared \
  56. -o $(echo $object | sed 's/.c$/.pd_linux/') $object
  57. done
  58. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/pd/extra/mrpeach/
  59. cp -p */*.pd_linux */*.pd $PKG/usr/lib$LIBDIRSUFFIX/pd/extra/mrpeach/
  60. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  61. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  62. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  63. cp -a net/LICENSE.txt net/README.txt $PKG/usr/doc/$PRGNAM-$VERSION
  64. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  65. mkdir -p $PKG/install
  66. cat $CWD/slack-desc > $PKG/install/slack-desc
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}