ices-cc.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/bin/sh
  2. # Slackware build script for ices-cc
  3. # Written by Rodney Cobb (rdc@ktabic.co.uk)
  4. # Modified by Antonio Hernández Blas <hba.nihilismus@gmail.com> for ices-cc
  5. PRGNAM=ices-cc
  6. VERSION=${VERSION:-0.4.1}
  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. cd $PRGNAM-$VERSION
  40. chown -R root:root .
  41. find . \
  42. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  43. -exec chmod 755 {} \; -o \
  44. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  45. -exec chmod 644 {} \;
  46. # Disable flac support with "with_flac" enviroment variable, please read:
  47. # http://www.linuxquestions.org/questions/slackware-14/ices0-for-slackware-767465/
  48. # ices-cc (0.4.1) has various file conflicts with ices (0.4, for mp3) ices (2.0.1, for Ogg)
  49. # so the suffix "-cc" will be added except for ices modules (/etc/modules/ices.* which
  50. # dont conflict.
  51. CFLAGS="$SLKCFLAGS" \
  52. CXXFLAGS="$SLKCFLAGS" \
  53. with_flac="no" \
  54. ./configure \
  55. --program-suffix="-cc" \
  56. --prefix=/usr \
  57. --libdir=/usr/lib${LIBDIRSUFFIX} \
  58. --sysconfdir=/etc \
  59. --localstatedir=/var \
  60. --mandir=/usr/man \
  61. --disable-static \
  62. --build=$ARCH-slackware-linux
  63. make
  64. make install DESTDIR=$PKG
  65. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
  66. grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  67. find $PKG/usr/man -type f -exec gzip -9 {} \;
  68. mv $PKG/etc/ices.conf.dist $PKG/etc/$PRGNAM.conf.new
  69. mv $PKG/etc/modules/ices.sh.dist $PKG/etc/modules/ices.sh.new
  70. mv $PKG/etc/modules/ices.pm.dist $PKG/etc/modules/ices.pm.new
  71. mv $PKG/etc/modules/ices.py.dist $PKG/etc/modules/ices.py.new
  72. # Create log directory
  73. mkdir -p $PKG/var/log/$PRGNAM
  74. # Install an init script
  75. mkdir -p $PKG/etc/rc.d
  76. install -m 644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
  77. rm -rf $PKG/usr/doc/ices
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. cp -a COPYING AUTHORS BUGS INSTALL NEWS README* TODO doc/*.html \
  80. $PKG/usr/doc/$PRGNAM-$VERSION
  81. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  82. mkdir -p $PKG/install
  83. cat $CWD/slack-desc > $PKG/install/slack-desc
  84. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  85. cd $PKG
  86. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}