vuze.SlackBuild 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. # Slackware build script for Azureus/Vuze
  3. # Written by Chris Lawrence <selivanow@gmail.com>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=vuze
  6. VERSION=${VERSION:-4604}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i486 ;;
  13. *) ARCH=$( uname -m ) ;;
  14. esac
  15. fi
  16. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  17. # the name of the created package would be, and then exit. This information
  18. # could be useful to other scripts.
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. set -e
  27. if [ "$ARCH" = "x86_64" ]; then
  28. LIBDIRSUFFIX="64"
  29. ARCHIVE=Vuze_${VERSION}_linux-$ARCH.tar.bz2
  30. else
  31. ARCH=i486
  32. LIBDIRSUFFIX=""
  33. ARCHIVE=Vuze_${VERSION}_linux.tar.bz2
  34. fi
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX} $PKG/usr/bin $OUTPUT
  37. tar xvf $CWD/$ARCHIVE -C $PKG/usr/lib${LIBDIRSUFFIX}
  38. # Set PROGRAM_DIR and MOZILLA_FIVE_HOME in the azureus program script
  39. sed "s%@LIBDIR@%/usr/lib${LIBDIRSUFFIX}%g" $CWD/vuze-set_paths.diff | \
  40. patch -p1 -d $PKG/usr/lib${LIBDIRSUFFIX}/vuze
  41. # Create two new symlinks in /usr/bin
  42. ( cd $PKG/usr/bin
  43. ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/azureus
  44. ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/vuze
  45. )
  46. mkdir -p $PKG/usr/share/{applications,pixmaps}
  47. cat $CWD/vuze.desktop > $PKG/usr/share/applications/vuze.desktop
  48. mv $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.png $PKG/usr/share/pixmaps
  49. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  50. cp -a\
  51. $PKG/usr/lib${LIBDIRSUFFIX}/vuze/README.txt \
  52. $PKG/usr/lib${LIBDIRSUFFIX}/vuze/TOS.txt \
  53. $PKG/usr/doc/$PRGNAM-$VERSION
  54. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  55. # Clean up some cruft.
  56. rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/vuze.desktop
  57. rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.txt
  58. rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.log
  59. mkdir $PKG/install
  60. cat $CWD/slack-desc > $PKG/install/slack-desc
  61. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  62. cd $PKG
  63. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE