NoPaste Service
DOWNLOAD
Language: Bash
Author: Matrix86
Description: Slackbuild For camstream [SLACKWARE 12]
Date: 03/02/08 13:26
  1. #!/bin/sh
  2. # Slackware 12 SlackBuild
  3. # Written by Matrix86
  4.  
  5. CWD=`pwd`
  6. TMP=${TMP:-/tmp/tgz}
  7. PKG=$TMP/package-camstream
  8. NAME=camstream
  9. VERSION=0.27
  10. CHOST=i486
  11. ARCH=${ARCH:-i486}
  12. BUILD=mtx1
  13.  
  14. if [ ! -f $NAME-$VERSION.tar.gz ]; then
  15.  wget http://www.smcc.demon.nl/camstream/download/camstream-0.27.tar.gz
  16. fi
  17. if [ ! -d $TMP ]; then
  18.  mkdir -p $TMP
  19. fi
  20. if [ ! -d $PKG ]; then
  21.  mkdir -p $PKG
  22. fi
  23.  
  24. if [ "$ARCH" = "i386" ]; then
  25.   SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
  26. elif [ "$ARCH" = "i486" ]; then
  27.   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  28. elif [ "$ARCH" = "i686" ]; then
  29.   SLKCFLAGS="-O2"
  30. elif [ "$ARCH" = "s390" ]; then
  31.   SLKCFLAGS="-O2"
  32. elif [ "$ARCH" = "x86_64" ]; then
  33.   SLKCFLAGS="-O2"
  34. fi
  35.  
  36.  
  37. tar xvfz $NAME-$VERSION.tar.gz
  38. cd $TMP
  39. cp -a $CWD/$NAME-$VERSION . || exit 1
  40.  
  41. find . \( -perm 777 -o -perm 775 -o -perm 711 \) -exec chmod 755 {} \;
  42. find . \( -perm 700 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \;
  43. find . \( -perm 666 -o -perm 664 -o -perm 600 \) -exec chmod 644 {} \;
  44. find . \( -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  45. chown -R root:root .
  46.  
  47. cd $NAME-$VERSION
  48.  
  49. CHOST="${SLKCHOST}"                                     \
  50. CFLAGS="${SLKCFLAGS}"                                   \
  51. CXXFLAGS="${SLKCXXFLAGS}"                               \
  52. ./configure                                             \
  53.   --prefix=/usr                                         \
  54.   --sysconfdir=/etc                                     \
  55.   --mandir=/usr/man                                     \
  56.   --infodir=/usr/info                                   \
  57.   --program-prefix=""                                   \
  58.   --program-suffix=""                                   \
  59.   --build=$ARCH-slackware-linux || exit 1
  60. make -j2 || exit 1
  61. make install DESTDIR=$PKG
  62.  
  63. ( cd $PKG
  64.   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  65.   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  66. )
  67.  
  68. if [ -d $PKG/usr/man ]; then
  69.   find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
  70. fi
  71.  
  72. if [ ! -d $PKG/usr/doc/$NAME-$VERSION ]; then
  73.   mkdir -p $PKG/usr/doc/$NAME-$VERSION
  74. fi
  75.  
  76. if [ ! -d $PKG/usr/share/applications ]; then
  77.   mkdir -p $PKG/usr/share/applications
  78. fi
  79.  
  80. #if [ ! -d $PKG/usr/share/pixmaps ]; then
  81. #  mkdir -p $PKG/usr/share/pixmaps
  82. #fi
  83.  
  84. mkdir -p $PKG/install
  85.  
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
  88. cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
  89. cp $CWD/camstream.desktop $PKG/usr/share/applications
  90. #cp $CWD/camstream.png $PKG/usr/share/pixmaps
  91. cp README INSTALL COPYING NEWS ChangeLog AUTHORS $PKG/usr/doc
  92.  
  93. cd $PKG
  94. makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz
  95.  
  96.  
  97. if [ "$1" = "--cleanup" ]; then
  98.   rm -rf $PKG
  99. fi