ices-cc.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/bash
  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. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=ices-cc
  7. VERSION=${VERSION:-0.4.3}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  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. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i486" ]; then
  29. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  51. -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  53. -exec chmod 644 {} \;
  54. # Disable flac support with "with_flac" enviroment variable, please read:
  55. # http://www.linuxquestions.org/questions/slackware-14/ices0-for-slackware-767465/
  56. # Also the new libmp4v2/faad2 don't seem compatible, so it has to go too
  57. # ices-cc (0.4.1) has various file conflicts with ices (0.4, for mp3) ices (2.0.1, for Ogg)
  58. # so the suffix "-cc" will be added except for ices modules (/etc/modules/ices.* which
  59. # dont conflict.
  60. CFLAGS="$SLKCFLAGS" \
  61. CXXFLAGS="$SLKCFLAGS" \
  62. with_faad="no" \
  63. with_flac="no" \
  64. ./configure \
  65. --program-suffix="-cc" \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --sysconfdir=/etc \
  69. --localstatedir=/var \
  70. --mandir=/usr/man \
  71. --disable-static \
  72. --build=$ARCH-slackware-linux
  73. make
  74. make install DESTDIR=$PKG
  75. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
  76. grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  77. find $PKG/usr/man -type f -exec gzip -9 {} \;
  78. mv $PKG/etc/ices.conf.dist $PKG/etc/$PRGNAM.conf.new
  79. mv $PKG/etc/modules/ices.sh.dist $PKG/etc/modules/ices.sh.new
  80. mv $PKG/etc/modules/ices.pm.dist $PKG/etc/modules/ices.pm.new
  81. mv $PKG/etc/modules/ices.py.dist $PKG/etc/modules/ices.py.new
  82. # Create log directory
  83. mkdir -p $PKG/var/log/$PRGNAM
  84. # Install an init script
  85. mkdir -p $PKG/etc/rc.d
  86. install -m 644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
  87. rm -rf $PKG/usr/doc/ices
  88. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  89. cp -a COPYING AUTHORS BUGS INSTALL NEWS README* TODO doc/*.html \
  90. $PKG/usr/doc/$PRGNAM-$VERSION
  91. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  92. mkdir -p $PKG/install
  93. cat $CWD/slack-desc > $PKG/install/slack-desc
  94. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  95. cd $PKG
  96. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE