summaryrefslogtreecommitdiff
path: root/network/vuze/vuze.SlackBuild
blob: ff9c09594d9547b9555532495a5b5459fbb261ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash

# Slackware build script for Azureus/Vuze
# Written by Chris Lawrence <selivanow@gmail.com>

PRGNAM=vuze
VERSION=${VERSION:-4604}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

if [ "$ARCH" = "x86_64" ]; then
  LIBDIRSUFFIX="64"
  ARCHIVE=Vuze_${VERSION}_linux-$ARCH.tar.bz2
else
  ARCH=i486
  LIBDIRSUFFIX=""
  ARCHIVE=Vuze_${VERSION}_linux.tar.bz2
fi

rm -rf $PKG
mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX} $PKG/usr/bin $OUTPUT
tar xvf $CWD/$ARCHIVE -C $PKG/usr/lib${LIBDIRSUFFIX}

# Set PROGRAM_DIR and MOZILLA_FIVE_HOME in the azureus program script
sed "s%@LIBDIR@%/usr/lib${LIBDIRSUFFIX}%g" $CWD/vuze-set_paths.diff | \
    patch -p1 -d $PKG/usr/lib${LIBDIRSUFFIX}/vuze

# Create two new symlinks in /usr/bin
( cd $PKG/usr/bin
  ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/azureus
  ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/vuze
)

mkdir -p $PKG/usr/share/{applications,pixmaps}
cat $CWD/vuze.desktop > $PKG/usr/share/applications/vuze.desktop
mv $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.png $PKG/usr/share/pixmaps

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a\
  $PKG/usr/lib${LIBDIRSUFFIX}/vuze/README.txt \
  $PKG/usr/lib${LIBDIRSUFFIX}/vuze/TOS.txt \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Clean up some cruft.
rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/vuze.desktop
rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.txt
rm $PKG/usr/lib${LIBDIRSUFFIX}/vuze/*.log

mkdir $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}