slackbuilds_ponce/network/uget/uget.SlackBuild
B. Watson d82405996a network/uget: Updated for version 2.2.1.
Signed-off-by: B. Watson <yalhcru@gmail.com>
2018-06-14 01:14:26 +01:00

114 lines
2.9 KiB
Bash

#!/bin/sh
# 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>
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 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
PRGNAM=uget
VERSION=${VERSION:-2.2.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
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 {} \;
LIBNOTIFY="${LIBNOTIFY:-yes}"
GSTREAMER="${GSTREAMER:-yes}"
[ "$LIBNOTIFY" = "no" ] && NOTIFYFLAG="--disable-notify"
[ "$GSTREAMER" = "no" ] && GSTFLAG="--disable-gstreamer"
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
$NOTIFYFLAG \
$GSTFLAG \
--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
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
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}