muscle.SlackBuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. # Slackware build script for muscle
  3. # Written by Petar Petrov, <ppetrov@paju.oulu.fi> and
  4. # hereby submitted to the public domain
  5. # THIS SLACKBUILD IS DISTRIBUTETD IN THE HOPE OF BEING
  6. # USEFUL BUT WITHOUT ANY WARRANTY. THE AUTHOR IS _NOT_
  7. # RESPONSIBLE FOR ANY DAMAGE OR DATA LOSS CAUSED BY IT.
  8. PRGNAM=muscle
  9. VERSION=${VERSION:-3.8.31}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i486 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. CWD=$(pwd)
  20. TMP=${TMP:-/tmp/SBo}
  21. PKG=$TMP/package-$PRGNAM
  22. OUTPUT=${OUTPUT:-/tmp}
  23. if [ "$ARCH" = "i486" ]; then
  24. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  25. LIBDIRSUFFIX=""
  26. elif [ "$ARCH" = "i686" ]; then
  27. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "x86_64" ]; then
  30. SLKCFLAGS="-O2 -fPIC"
  31. LIBDIRSUFFIX="64"
  32. else
  33. SLKCFLAGS="-O2"
  34. LIBDIRSUFFIX=""
  35. fi
  36. set -e
  37. rm -rf $PKG
  38. mkdir -p $TMP $PKG $OUTPUT
  39. cd $TMP
  40. rm -rf ${PRGNAM}${VERSION}
  41. tar xvf $CWD/${PRGNAM}${VERSION}_src.tar.gz
  42. cd ${PRGNAM}${VERSION}
  43. chown -R root:root .
  44. find -L . \
  45. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  46. -exec chmod 755 {} \; -o \
  47. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  48. -exec chmod 644 {} \;
  49. cd ./src
  50. ENV_GCC_OPTS="$SLKCFLAGS" \
  51. make
  52. install -D -m755 muscle $PKG/usr/bin/muscle
  53. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  54. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  55. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  56. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  57. cat $CWD/References > $PKG/usr/doc/$PRGNAM-$VERSION/References
  58. mkdir -p $PKG/install
  59. cat $CWD/slack-desc > $PKG/install/slack-desc
  60. cd $PKG
  61. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}