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-11-06 20:11:42 +01:00
|
|
|
# Updated to 0.8.7 by Brian Kysela 2010-10-27
|
2011-03-28 03:12:41 +02:00
|
|
|
# Patched for new ncurses in 13.37 by rworkman
|
2011-06-18 04:09:08 +02:00
|
|
|
# Updated to 0.8.8 by Brian Kysela 2011-05-09
|
2011-07-03 06:49:53 +02:00
|
|
|
# Updated to 0.8.9 by Brian Kysela 2011-06-22
|
2011-12-12 22:50:13 +01:00
|
|
|
# Updated to 0.9.0 by Brian Kysela 2011-12-12
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2010-05-13 00:38:10 +02:00
|
|
|
PRGNAM=rtorrent
|
2011-12-12 22:50:13 +01:00
|
|
|
VERSION=0.9.0
|
2012-09-10 09:34:37 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-11 20:01:43 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:14:07 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) 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 .
|
2013-11-25 12:23:31 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-11 20:01:43 +02:00
|
|
|
|
2012-09-10 09:34:37 +02:00
|
|
|
LDFLAGS="-lpthread" \
|
2010-05-11 20:01:43 +02:00
|
|
|
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-11-06 20:11:42 +01:00
|
|
|
# Taken out as developer removed "out-of-date man page". If you want it back
|
|
|
|
# in you will need to edit doc/Makefile.am in the source and uncomment
|
|
|
|
# 'man_MANS = rtorrent.1' as well as the line below.
|
|
|
|
#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 \
|
2011-12-12 22:50:13 +01:00
|
|
|
AUTHORS COPYING INSTALL README 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}
|