2010-05-11 20:01:43 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for rtorrent
|
2010-05-13 00:38:10 +02:00
|
|
|
# Written by Brian Kysela <brian.kysela@gmail.com> 2009-11-04
|
2010-03-03 21:23:38 +01:00
|
|
|
# Updated to 0.8.6 by Brian Kysela 2010-02-16
|
2010-04-22 03:32:33 +02:00
|
|
|
# Updated to include rtorrent.rc 2010-04-20
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
PRGNAM=rtorrent
|
2010-03-03 21:23:38 +01:00
|
|
|
VERSION=0.8.6
|
2010-04-22 03:32:33 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-11 20:01:43 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:14:07 +02:00
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 20:01:43 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2010-05-13 00:38:10 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
2010-05-11 20:01:43 +02:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 00:38:10 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:43 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 00:38:10 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:43 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2010-05-13 00:38:10 +02:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:14:07 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:43 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 20:01:43 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-13 00:38:10 +02:00
|
|
|
rm -rf $TMP/$PRGNAM-$VERSION
|
|
|
|
cd $TMP
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 20:01:43 +02:00
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:38:10 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 20:01:43 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2010-05-13 00:38:10 +02:00
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
gzip -9 $PKG/usr/man/man?/*.?
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
2010-04-22 03:32:33 +02:00
|
|
|
AUTHORS COPYING INSTALL NEWS README TODO doc/rtorrent.rc \
|
2010-05-13 00:38:10 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM-SlackBuild
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-11 20:01:43 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:38:10 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|