ices.SlackBuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/sh
  2. # Slackware build script for ices
  3. # Written by Rodney Cobb (rdc@ktabic.co.uk)
  4. PRGNAM=ices
  5. VERSION=${VERSION:-2.0.1}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. # Automatically determine the architecture we're building on:
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. # Unless $ARCH is already set, use uname -m for all other archs:
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. CWD=$(pwd)
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. if [ "$ARCH" = "i486" ]; then
  22. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "i686" ]; then
  25. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "x86_64" ]; then
  28. SLKCFLAGS="-O2 -fPIC"
  29. LIBDIRSUFFIX="64"
  30. else
  31. SLKCFLAGS="-O2"
  32. LIBDIRSUFFIX=""
  33. fi
  34. set -e # Exit on most errors
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM-$VERSION
  39. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  40. cd $PRGNAM-$VERSION
  41. chown -R root:root .
  42. find . \
  43. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  44. -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  46. -exec chmod 644 {} \;
  47. CFLAGS="$SLKCFLAGS" \
  48. CXXFLAGS="$SLKCFLAGS" \
  49. ./configure \
  50. --prefix=/usr \
  51. --libdir=/usr/lib${LIBDIRSUFFIX} \
  52. --sysconfdir=/etc \
  53. --localstatedir=/var \
  54. --mandir=/usr/man \
  55. --disable-static \
  56. --build=$ARCH-slackware-linux
  57. make
  58. make install DESTDIR=$PKG
  59. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  60. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  61. # Create log directory ; file will be created in doinst.sh if needed
  62. mkdir -p $PKG/var/log/ices
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/sample_configs
  64. cp -a COPYING AUTHORS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a conf/*.xml $PKG/usr/doc/$PRGNAM-$VERSION/sample_configs
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. ( cd $PKG/usr/doc/$PRGNAM-$VERSION ; ln -s /usr/share/ices html )
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  71. cd $PKG
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}