scipy.SlackBuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # Build script for the Python SciPy package
  3. # Written by Eugene Suter <easuter@gmail.com>
  4. # Updated to 0.7.2 by João Felipe Santos <joao.eel@gmail.com>
  5. # Updated up to 0.14.0 by Serban Udrea <S.Udrea@gsi.de>
  6. # Added support for building with debugging symbols (S. Udrea)
  7. PRGNAM=scipy
  8. VERSION=${VERSION:-0.14.0}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. CWD=$(pwd)
  19. TMP=${TMP:-/tmp/SBo}
  20. PKG=${PKG:-$TMP/package-$PRGNAM}
  21. OUTPUT=${OUTPUT:-/tmp}
  22. set -e
  23. rm -rf $PKG
  24. mkdir -p $TMP $PKG $OUTPUT
  25. cd $TMP
  26. rm -rf $PRGNAM-$VERSION
  27. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  28. cd $PRGNAM-$VERSION
  29. chown -R root:root .
  30. find -L . \
  31. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  32. -exec chmod 755 {} \; -o \
  33. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  34. -exec chmod 644 {} \;
  35. DEBUG=${DEBUG:-no}
  36. case "$DEBUG" in
  37. [yY]|[yY][eE][sS]) DEBUG="y" ;;
  38. *) DEBUG="" ;;
  39. esac
  40. if [ ! "$DEBUG" ]; then
  41. python setup.py install --root $PKG
  42. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  43. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  44. else
  45. python setup.py build --debug
  46. python setup.py install --root $PKG
  47. fi
  48. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  49. cp -a LICENSE.txt THANKS.txt INSTALL.txt \
  50. $PKG/usr/doc/$PRGNAM-$VERSION
  51. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  52. find $PKG/usr/doc -type f -exec chmod 0644 {} \;
  53. mkdir -p $PKG/install
  54. cat $CWD/slack-desc > $PKG/install/slack-desc
  55. cd $PKG
  56. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}