python-lastfm.SlackBuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # Slackware build script for python-lastfm
  3. # Written by Mihai Militaru <mihai.militaru@gmx.com>
  4. # March 2009
  5. PRGNAM=python-lastfm
  6. ORIGNAM=lastfm
  7. VERSION=${VERSION:-0.1}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. # Automatically determine the architecture we're building on:
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. # Unless $ARCH is already set, use uname -m for all other archs:
  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/$ORIGNAM-$VERSION.tar.gz
  42. cd $ORIGNAM-$VERSION
  43. chown -R root:root .
  44. find . \
  45. \( -perm 777 -o -perm 775 -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. patch -p0 < $CWD/nostdeb.diff
  50. python setup.py install --root $PKG
  51. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  52. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  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}