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

deluge.SlackBuild

By: a guest on Sep 1st, 2013  |  syntax: None  |  size: 3.66 KB  |  views: 54  |  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 deluge.
  4.  
  5. # Copyright 2010-2011 Marco Bonetti <sid77@slackware.it>
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. #    notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24.  
  25. PRGNAM=deluge
  26. VERSION=${VERSION:-1.3.6}
  27. LIBTVER=0.16.10
  28. BUILD=${BUILD:-1}
  29. TAG=${TAG:-_SBo}
  30.  
  31. # Automatically determine the architecture we're building on:
  32. if [ -z "$ARCH" ]; then
  33.   case "$( uname -m )" in
  34.     i?86) ARCH=i486 ;;
  35.     arm*) ARCH=arm ;;
  36.     # Unless $ARCH is already set, use uname -m for all other archs:
  37.        *) ARCH=$( uname -m ) ;;
  38.   esac
  39. fi
  40.  
  41. CWD=$(pwd)
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45.  
  46. DOCS="LICENSE ChangeLog* README"
  47.  
  48. if [ "$ARCH" = "i486" ]; then
  49.   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  50.   LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "i686" ]; then
  52.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  53.   LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "x86_64" ]; then
  55.   SLKCFLAGS="-O2 -fPIC"
  56.   LIBDIRSUFFIX="64"
  57. else
  58.   SLKCFLAGS="-O2"
  59.   LIBDIRSUFFIX=""
  60. fi
  61.  
  62. set -e
  63.  
  64. rm -rf $PKG
  65. mkdir -p $TMP $PKG $OUTPUT
  66. cd $TMP
  67. rm -rf $PRGNAM-$VERSION
  68. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  69. cd $PRGNAM-$VERSION
  70. tar xvf $CWD/libtorrent-rasterbar-$LIBTVER.tar.?z*
  71. chown -R root:root .
  72.  
  73. find . \
  74.  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  75.  -exec chmod 755 {} \; -o \
  76.  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  77.  -exec chmod 644 {} \;
  78.  
  79. patch -p1 -d libtorrent-rasterbar-$LIBTVER -i $CWD/boost-154.patch
  80. ( cd libtorrent-rasterbar-$LIBTVER
  81. CFLAGS=$SLKCFLAGS \
  82. CXXFLAGS=$SLKCFLAGS \
  83. ./configure --prefix=/usr \
  84.     --libdir=/usr/lib${LIBDIRSUFFIX} \
  85.     --enable-python-binding \
  86.     --with-boost-libdir=/usr/lib${LIBDIRSUFFIX} \
  87.     --build=$ARCH-slackware-linux
  88.     #--with-boost-system=lib
  89. make
  90. make install DESTDIR=$PKG )
  91.  
  92. python setup.py clean -a
  93. python setup.py build || exit 1
  94. python setup.py install --prefix=/usr --root=$PKG --optimize=1 || exit 1
  95. python setup.py install_data --root=$PKG --install-dir=$PKG/usr || exit 1
  96.  
  97. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  98.   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  99.  
  100. mkdir -p $PKG/usr/man
  101. mv $PKG/usr/share/man/man1 $PKG/usr/man
  102. rm -r $PKG/usr/share/man
  103. find $PKG/usr/man -type f -exec gzip -9 {} \;
  104.  
  105. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  106. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  107. cat $CWD/slack-desc > $PKG/usr/doc/$PRGNAM-$VERSION/slack-desc
  108. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  109.  
  110. mkdir -p $PKG/install
  111. cat $CWD/slack-desc > $PKG/install/slack-desc
  112. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  113.  
  114. cd $PKG
  115. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
clone this paste RAW Paste Data