Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

ponce

By: a guest on Nov 3rd, 2009  |  syntax: None  |  size: 2.11 KB  |  views: 81  |  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. # Slackware build script for <libofa>
  3. # Written by Michales Michaloudes korgie@gmail.com
  4. # slighty modified to build no examples by Ponce
  5.  
  6. PRGNAM=libofa
  7. VERSION=${VERSION:-0.9.3}
  8. ARCH=${ARCH:-x86_64}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-ponce}
  11.  
  12. CWD=$(pwd)
  13. TMP=${TMP:-/tmp/SBo}
  14. PKG=$TMP/package-$PRGNAM
  15. OUTPUT=${OUTPUT:-/tmp}
  16.  
  17. if [ "$ARCH" = "i486" ]; then
  18.   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  19.   LIBDIRSUFFIX=""
  20. elif [ "$ARCH" = "i686" ]; then
  21.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  22.   LIBDIRSUFFIX=""
  23. elif [ "$ARCH" = "x86_64" ]; then
  24.   SLKCFLAGS="-O2 -fPIC"
  25.   LIBDIRSUFFIX="64"
  26. fi
  27.  
  28. set -e
  29.  
  30. rm -rf $PKG
  31. mkdir -p $TMP $PKG $OUTPUT
  32. cd $TMP
  33. rm -rf $PRGNAM-$VERSION
  34. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  35. cd $PRGNAM-$VERSION
  36. chown -R root:root .
  37. find . \
  38.  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  39.  -exec chmod 755 {} \; -o \
  40.  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  41.  -exec chmod 644 {} \;
  42.  
  43. # Thanks, Gentoo guys :-)
  44. # http://mirrors.usc.edu/pub/linux/distributions/gentoo/media-libs/libofa/files/
  45. patch -p0 < $CWD/libofa-0.9.3-gcc-4.patch
  46. patch -p1 < $CWD/libofa-0.9.3-gcc-4.3.patch
  47. patch -p1 < $CWD/libofa-noexamples.patch
  48.  
  49. CFLAGS="$SLKCFLAGS" \
  50. CXXFLAGS="$SLKCFLAGS" \
  51. ./configure \
  52.   --prefix=/usr \
  53.   --with-pic \
  54.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  55.   --sysconfdir=/etc \
  56.   --localstatedir=/var \
  57.   --mandir=/usr/man \
  58.   --disable-static \
  59.   --build=$ARCH-slackware-linux
  60.  
  61. make
  62. make install DESTDIR=$PKG
  63.  
  64. ( cd $PKG
  65.   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
  66.     xargs strip --strip-unneeded 2> /dev/null || true
  67.   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
  68.     xargs strip --strip-unneeded 2> /dev/null
  69. )
  70.  
  71. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  72. cp -a AUTHORS COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  73. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  74.  
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77.  
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
clone this paste RAW Paste Data