Want more features on Pastebin? Sign Up, it's FREE!
Guest

ponce

By: a guest on Sep 9th, 2009  |  syntax: None  |  size: 2.04 KB  |  views: 83  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. # Slackware build script for smb4k
  4. # Project Homepage: http://smb4k.berlios.de/
  5.  
  6. # Written by Roberto Neri <rneri@libero.it>
  7. # Modified by Robby Workman <rworkman@slackbuilds.org>
  8. # Totally twisted by Ponce
  9.  
  10. PRGNAM=smb4k
  11. VERSION=${VERSION:-20090909}
  12. ARCH=${ARCH:-x86_64}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-ponce}
  15.  
  16. CWD=$(pwd)
  17. TMP=${TMP:-/tmp/txz}
  18. PKG=$TMP/package-$PRGNAM
  19. OUTPUT=${OUTPUT:-/tmp}
  20.  
  21. if [ "$ARCH" = "i486" ]; then
  22.   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. elif [ "$ARCH" = "i686" ]; then
  24.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  25. elif [ "$ARCH" = "x86_64" ]; then
  26.   SLKCFLAGS="-O2 -fPIC"
  27.   SLKCLDLAGS="-L/usr/lib64 -L/lib64"
  28.   LIBDIRSUFFIX="64"
  29. fi
  30.  
  31. set -e
  32.  
  33. rm -rf $PKG
  34. mkdir -p $TMP $PKG $OUTPUT
  35. cd $TMP
  36. rm -rf $PRGNAM-$VERSION
  37. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  38. cd $PRGNAM-$VERSION
  39.  
  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.  
  47. cmake \
  48.   -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  49.   -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  50.   -DCMAKE_BUILD_TYPE=Release \
  51.   -DCMAKE_INSTALL_PREFIX=/usr \
  52.   -DMAN_INSTALL_DIR=/usr/man \
  53.   -DSYSCONF_INSTALL_DIR=/etc/kde \
  54.   -DCOMPILE_KIOSLAVE=false \
  55.   -DCOMPILE_KONQPLUGIN=true \
  56.   -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  57.   .
  58. make $NUMJOBS || make || exit 1
  59. make install DESTDIR=$PKG || exit 1
  60.  
  61. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  62. cp -a AUTHORS BUGS ChangeLog COPYING FAQ README TODO \
  63.     $PKG/usr/doc/$PRGNAM-$VERSION
  64. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  65.  
  66. ( cd $PKG
  67.   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  68.   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  69. )
  70.  
  71. mkdir -p $PKG/install
  72. cat $CWD/slack-desc > $PKG/install/slack-desc
  73.  
  74. cd $PKG
  75. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
clone this paste RAW Paste Data