slackbuilds_ponce/network/uget/uget.SlackBuild

129 lines
3.3 KiB
Text
Raw Normal View History

#!/bin/bash
2010-05-13 01:00:25 +02:00
# Slackware build script for uget
# Originally written by Morten Juhl-Johansen Zölde-Fejér <email removed>
# Updated and now maintained by B. Watson <yalhcru@gmail.com>
2010-05-13 01:00:25 +02:00
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20210926 bkw: BUILD=2, fix build on -current/15.0
# 20200223 bkw: update for 2.2.3_1
# 20191130 bkw: update for 2.2.2
# 20180612 bkw: update for 2.2.1
# 20180109 bkw:
# - update for 2.2.0
# - get rid of ARIA2 variable, since it's become a runtime dep
# - get rid of --disable-gstreamer, since gstreamer-1.x is in
# Slackware these days. Add GSTREAMER variable to disable it.
# - update README and slack-desc
# 20170827 bkw: update for 2.0.10
# 20170324 bkw:
# - update for 2.0.9
# - AUTHORS no longer empty, include in package
# 20160727 bkw: upgrade to 2.0.8
# 20150910 bkw:
# - upgrade to 2.0.1
# - get rid of curlopt_nosignal.diff (no longer needed)
# - fix WTFPL URL
# - add LIBNOTIFY=no
# - document build options in slack-desc
# - cleanup README
# - install developer docs doc/*.txt
# - don't install empty AUTHORS and ChangeLog
cd $(dirname $0) ; CWD=$(pwd)
2010-05-13 01:00:25 +02:00
PRGNAM=uget
VERSION=${VERSION:-2.2.3_1}
BUILD=${BUILD:-2}
2010-05-13 01:00:25 +02:00
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
2010-05-13 01:00:25 +02:00
# Tarball filename version number doesn't match top-level dir inside
# tarball, and neither matches VERSION 'cause we can't use hyphens.
# This stuff can safely be left in place: if VERSION contains no _
# character, TARVER == DIRVER == VERSION.
TARVER=${VERSION/_/-}
DIRVER="$( echo $VERSION | cut -d_ -f1 )"
2010-05-27 05:22:14 +02:00
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
2016-08-19 11:00:18 +02:00
i?86) ARCH=i586 ;;
2010-05-27 05:22:14 +02:00
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
2010-05-13 01:00:25 +02:00
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
2016-08-19 11:00:18 +02:00
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
2010-05-13 01:00:25 +02:00
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
2010-05-27 05:22:14 +02:00
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
2010-05-13 01:00:25 +02:00
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$DIRVER
tar xvf $CWD/$PRGNAM-$TARVER.tar.gz
cd $PRGNAM-$DIRVER
2010-05-13 01:00:25 +02:00
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
2010-05-13 01:00:25 +02:00
LIBNOTIFY="${LIBNOTIFY:-yes}"
GSTREAMER="${GSTREAMER:-yes}"
[ "$LIBNOTIFY" = "no" ] && NOTIFYFLAG="--disable-notify"
[ "$GSTREAMER" = "no" ] && GSTFLAG="--disable-gstreamer"
SLKCFLAGS+=" -fcommon"
2010-05-13 01:00:25 +02:00
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
$NOTIFYFLAG \
$GSTFLAG \
2010-05-13 01:00:25 +02:00
--prefix=/usr \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
# 20170324 bkw: NEWS and ChangeLog are 0-byte placeholders in uget-2.0.9,
# add them back if this changes in future releases.
cp -a AUTHORS COPYING README doc/*.txt $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-13 01:00:25 +02:00
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
sed -e "s,@A,$GSTREAMER," \
-e "s,@L,$LIBNOTIFY," \
$CWD/slack-desc > $PKG/install/slack-desc
2010-05-13 01:00:25 +02:00
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE