pianobar.SlackBuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/sh
  2. # Slackware build script for pianobar
  3. # Written by Phillip Warner <pc_warner@yahoo.com>
  4. PRGNAM=pianobar
  5. VERSION=${VERSION:-2012.05.06}
  6. BUILD=${BUILD:-1}
  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/usr $OUTPUT
  35. cd $TMP
  36. rm -rf $PRGNAM-$VERSION
  37. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  38. cd $PRGNAM-$VERSION
  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. # Fix Makefile
  46. patch -p1 < $CWD/Makefile.diff
  47. CFLAGS="$SLKCFLAGS" \
  48. force_arch="$ARCH" \
  49. gmake DISABLE_FAAD=1
  50. gmake install DESTDIR=$PKG PREFIX="/usr" MANDIR="/usr/man"
  51. # Install helper script
  52. install -m 0755 $CWD/pianobarctl $PKG/usr/bin/pianobarctl
  53. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  54. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  55. find $PKG/usr/man -type f -exec gzip -9 {} \;
  56. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  57. cp -a COPYING README INSTALL ChangeLog contrib/config-example \
  58. $PKG/usr/doc/$PRGNAM-$VERSION
  59. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/example-scripts
  60. cp -a contrib/*.sh contrib/eventcmd-examples/ \
  61. $PKG/usr/doc/$PRGNAM-$VERSION/example-scripts
  62. chmod -x $PKG/usr/doc/$PRGNAM-$VERSION/example-scripts/*
  63. chmod -x $PKG/usr/doc/$PRGNAM-$VERSION/example-scripts/eventcmd-examples/*
  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}