2010-05-11 15:01:25 +02:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
# Slackware build script for aMule
|
2010-05-13 00:35:30 +02:00
|
|
|
|
# Written by Iskar Enev (<iskar.enev[@]gmail.com>)
|
2010-05-11 15:01:25 +02:00
|
|
|
|
# Modified by the SlackBuilds.org project
|
2011-09-06 03:46:28 +02:00
|
|
|
|
# Maintained by Ozan Türkyılmaz ozan.turkyilmaz@gmial.com
|
2010-05-11 15:01:25 +02:00
|
|
|
|
|
|
|
|
|
PRGNAM=aMule
|
2018-11-20 14:00:04 +01:00
|
|
|
|
VERSION=${VERSION:-r11003}
|
2012-04-30 02:00:05 +02:00
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 15:01:25 +02:00
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:25:02 +02:00
|
|
|
|
|
2010-06-04 07:12:14 +02:00
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
|
case "$( uname -m )" in
|
2018-08-08 22:27:58 +02:00
|
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:12:14 +02:00
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
|
2010-05-11 15:01:25 +02:00
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
2018-08-08 22:27:58 +02:00
|
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:35:30 +02:00
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 15:01:25 +02:00
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:35:30 +02:00
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:25:02 +02:00
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:35:30 +02:00
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:12:14 +02:00
|
|
|
|
else
|
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 15:01:25 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2011-09-06 03:46:28 +02:00
|
|
|
|
DAEMON=${DAEMON:-no}
|
|
|
|
|
CMD=${CMD:-no}
|
|
|
|
|
WEBSERVER=${WEBSERVER:-no}
|
|
|
|
|
ALC=${ALC:-no}
|
|
|
|
|
ALCC=${ALCC:-no}
|
|
|
|
|
XAS=${XAS:-no}
|
|
|
|
|
GEOIP=${GEOIP:-no}
|
|
|
|
|
MMAP=${MMAP:-no}
|
|
|
|
|
OPTIMIZE=${OPTIMIZE:-yes}
|
|
|
|
|
PLASMAMULE=${PLASMAMULE:-no}
|
|
|
|
|
|
|
|
|
|
if [ "$DAEMON" = "yes" ]; then
|
|
|
|
|
AMULE_DAEMON="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_DAEMON="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$CMD" = "yes" ]; then
|
|
|
|
|
AMULE_CMD="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_CMD="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$WEBSERVER" = "yes" ]; then
|
|
|
|
|
AMULE_WEBSERVER="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_WEBSERVER="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$ALC" = "yes" ]; then
|
|
|
|
|
AMULE_ALC="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_ALC="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$ALCC" = "yes" ]; then
|
|
|
|
|
AMULE_ALCC="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_ALCC="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$XAS" = "yes" ]; then
|
|
|
|
|
AMULE_XAS="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_XAS="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$GEOIP" = "yes" ]; then
|
|
|
|
|
AMULE_GEOIP="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_GEOIP="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$MMAP" = "yes" ]; then
|
|
|
|
|
AMULE_MMAP="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_MMAP="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$OPTIMIZE" = "yes" ]; then
|
|
|
|
|
AMULE_OPTIMIZE="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_OPTIMIZE="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$PLASMAMULE" = "yes" ]; then
|
|
|
|
|
AMULE_PLASMAMULE="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_PLASMAMULE="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
2018-08-08 22:27:58 +02:00
|
|
|
|
if [ "$GUI" = "yes" ]; then
|
|
|
|
|
AMULE_GUI="enable"
|
|
|
|
|
else
|
|
|
|
|
AMULE_GUI="disable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
2010-05-11 22:25:02 +02:00
|
|
|
|
set -e
|
|
|
|
|
|
2010-05-11 15:01:25 +02:00
|
|
|
|
rm -rf $PKG
|
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-11 22:25:02 +02:00
|
|
|
|
cd $TMP
|
2010-05-11 15:01:25 +02:00
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2012-04-30 02:00:05 +02:00
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
2010-05-11 22:25:02 +02:00
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 15:01:25 +02:00
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
|
find -L . \
|
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2010-05-11 22:25:02 +02:00
|
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
|
-exec chmod 644 {} \;
|
2010-05-11 15:01:25 +02:00
|
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
|
./configure \
|
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:35:30 +02:00
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 15:01:25 +02:00
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
|
--localstatedir=/var \
|
|
|
|
|
--mandir=/usr/man \
|
2012-04-30 02:00:05 +02:00
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
2010-05-11 15:01:25 +02:00
|
|
|
|
--with-wx-config=/usr/bin/wx-config \
|
2010-05-13 00:35:30 +02:00
|
|
|
|
--disable-debug \
|
2018-08-08 22:27:58 +02:00
|
|
|
|
--$AMULE_GUI-amule-gui \
|
2011-09-06 03:46:28 +02:00
|
|
|
|
--$AMULE_DAEMON-amule-daemon \
|
|
|
|
|
--$AMULE_CMD-amulecmd \
|
|
|
|
|
--$AMULE_WEBSERVER-webserver \
|
|
|
|
|
--$AMULE_ALC-alc \
|
|
|
|
|
--$AMULE_ALCC-alcc \
|
|
|
|
|
--$AMULE_XAS-xas \
|
|
|
|
|
--$AMULE_GEOIP-geoip \
|
|
|
|
|
--$AMULE_MMAP-mmap \
|
|
|
|
|
--$AMULE_PLASMAMULE-plasmamule \
|
|
|
|
|
--$AMULE_OPTIMIZE-optimize \
|
2010-05-13 00:35:30 +02:00
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 22:25:02 +02:00
|
|
|
|
|
|
|
|
|
make
|
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-11 15:01:25 +02:00
|
|
|
|
|
2010-05-19 08:41:52 +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 15:01:25 +02:00
|
|
|
|
|
2011-09-06 03:46:28 +02:00
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
|
2010-05-11 15:01:25 +02:00
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-13 00:35:30 +02:00
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 15:01:25 +02:00
|
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:35:30 +02:00
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|