2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2010-05-13 01:00:25 +02:00
|
|
|
|
2015-09-10 23:59:06 +02:00
|
|
|
# Slackware build script for uget
|
2018-01-10 21:56:14 +01:00
|
|
|
# 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
|
|
|
|
2015-09-10 23:59:06 +02:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2021-09-26 08:13:19 +02:00
|
|
|
# 20210926 bkw: BUILD=2, fix build on -current/15.0
|
2020-02-23 19:52:14 +01:00
|
|
|
# 20200223 bkw: update for 2.2.3_1
|
2019-12-01 01:51:17 +01:00
|
|
|
# 20191130 bkw: update for 2.2.2
|
2018-06-12 09:56:57 +02:00
|
|
|
# 20180612 bkw: update for 2.2.1
|
|
|
|
|
2018-01-10 21:56:14 +01:00
|
|
|
# 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
|
|
|
|
|
2019-12-01 01:51:17 +01:00
|
|
|
# 20170827 bkw: update for 2.0.10
|
2017-08-27 19:25:28 +02:00
|
|
|
|
2017-03-24 18:38:44 +01:00
|
|
|
# 20170324 bkw:
|
|
|
|
# - update for 2.0.9
|
|
|
|
# - AUTHORS no longer empty, include in package
|
|
|
|
|
2019-12-01 01:51:17 +01:00
|
|
|
# 20160727 bkw: upgrade to 2.0.8
|
2017-03-24 18:38:44 +01:00
|
|
|
|
2015-09-10 23:59:06 +02:00
|
|
|
# 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
|
2012-12-30 02:48:59 +01:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-13 01:00:25 +02:00
|
|
|
PRGNAM=uget
|
2020-02-23 19:52:14 +01:00
|
|
|
VERSION=${VERSION:-2.2.3_1}
|
2021-09-26 08:13:19 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-13 01:00:25 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2010-05-13 01:00:25 +02:00
|
|
|
|
2020-02-23 19:52:14 +01: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
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
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
|
2020-02-23 19:52:14 +01:00
|
|
|
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 .
|
2019-12-01 01:51:17 +01:00
|
|
|
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
|
|
|
|
2015-09-10 23:59:06 +02:00
|
|
|
LIBNOTIFY="${LIBNOTIFY:-yes}"
|
2018-01-10 21:56:14 +01:00
|
|
|
GSTREAMER="${GSTREAMER:-yes}"
|
2011-06-01 05:04:27 +02:00
|
|
|
|
2015-09-10 23:59:06 +02:00
|
|
|
[ "$LIBNOTIFY" = "no" ] && NOTIFYFLAG="--disable-notify"
|
2018-01-10 21:56:14 +01:00
|
|
|
[ "$GSTREAMER" = "no" ] && GSTFLAG="--disable-gstreamer"
|
2012-01-06 14:18:15 +01:00
|
|
|
|
2021-09-26 08:13:19 +02:00
|
|
|
SLKCFLAGS+=" -fcommon"
|
|
|
|
|
2010-05-13 01:00:25 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
2015-09-10 23:59:06 +02:00
|
|
|
$NOTIFYFLAG \
|
2018-01-10 21:56:14 +01:00
|
|
|
$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
|
2017-03-24 18:38:44 +01:00
|
|
|
# 20170324 bkw: NEWS and ChangeLog are 0-byte placeholders in uget-2.0.9,
|
2015-09-10 23:59:06 +02:00
|
|
|
# add them back if this changes in future releases.
|
2017-03-24 18:38:44 +01:00
|
|
|
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
|
2018-01-10 21:56:14 +01:00
|
|
|
sed -e "s,@A,$GSTREAMER," \
|
2015-09-10 23:59:06 +02:00
|
|
|
-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
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|