diff options
Diffstat (limited to 'network/transmission/transmission.SlackBuild')
-rw-r--r-- | network/transmission/transmission.SlackBuild | 144 |
1 files changed, 54 insertions, 90 deletions
diff --git a/network/transmission/transmission.SlackBuild b/network/transmission/transmission.SlackBuild index 0d4e80716c..5ccebeb9b7 100644 --- a/network/transmission/transmission.SlackBuild +++ b/network/transmission/transmission.SlackBuild @@ -4,7 +4,7 @@ # Copyright 2007 Vasilis Papavasileiou <email removed> # Copyright 2008-2011 Iskar Enev <email removed> # Copyright 2011-2013 Niels Horn, Rio de Janeiro, Brazil -# Copyright 2015 B. Watson <yalhcru@gmail.com> +# Copyright 2015 B. Watson <urchlay@slackware.uk> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,6 +24,17 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20231219 bkw: update for v4.0.5, minor man page tweaks. +# 20230912 bkw: update for v4.0.4. +# 20230510 bkw: update for v4.0.3. remove the warning about D-Bus from README, +# it no longer applies (transmission-gtk works without it). +# 20230320 bkw: update for v4.0.2. add -DREBUILD_WEB=OFF to allow building +# without using the network, if nodejs is installed. thanks +# to Ruben Schuller for pointing this out. +# 20230208 bkw: update for v4.0.0, which has only been out for about 5 hours. +# - Disable the qt5 UI by default. There's no reason to build both GUIs +# by default. User can still say GTK=no QT=yes to get only the qt UI. +# 20210926 bkw: BUILD=2, restore Qt5 build. 15.0 not yet released, but "soon". # 20200525 bkw: update for v3.00. # Drop Qt GUI and QT=yes, due to 14.2's old gcc/libstdc++. # It will come back when 15.0 releases. @@ -41,7 +52,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=transmission -VERSION=${VERSION:-3.00} +VERSION=${VERSION:-4.0.5} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -54,9 +65,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -66,8 +74,6 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -DOCS="AUTHORS COPYING NEWS.md README.md" - if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -84,42 +90,30 @@ fi set -e -# 20200525 bkw: I had to drop the Qt client, let's make sure the user -# knows that. -if [ "${QT:-no}" != "no" ]; then - cat <<EOF 1>&2 - -********************************************************************** -The Qt GUI in this version of transmission can't be built on Slackware -14.2. If you don't mind using an older version of transmission, you -can install transmission-qt4 to get a Qt GUI. -********************************************************************** - -EOF - exit 1 -fi - GTK="${GTK:-yes}" -#QT="${QT:-yes}" +QT="${QT:-no}" CLI="${CLI:-yes}" DAEMON="${DAEMON:-yes}" -if [ "$GTK" != "yes" -a "$CLI" != "yes" -a "$DAEMON" != "yes" ]; then +if [ "$GTK" != "yes" -a "$CLI" != "yes" -a "$DAEMON" != "yes" -a "$QT" != "yes" ]; then cat <<EOF 1>&2 ****************************************************************** Can't build transmission with everything disabled, at least one of -GTK CLI DAEMON must be 'yes'. +GTK CLI QT DAEMON must be 'yes'. ****************************************************************** EOF exit 1 fi -# anything but lowercase "yes" is considered a no! -[ "$GTK" != "yes" ] && GTKOPT="no" || GTKOPT="yes" -[ "$CLI" != "yes" ] && CLIOPT="dis" || CLIOPT="en" -[ "$DAEMON" != "yes" ] && DAEMOPT="dis" || DAEMOPT="en" +# Anything but lowercase "yes" is considered a no! +# cmake didn't used to be case-sensitive about on and off. +# It feels like BDSM, and not in a good way. +[ "$QT" != "yes" ] && QTOPT="OFF" || QTOPT="ON" +[ "$GTK" != "yes" ] && GTKOPT="OFF" || GTKOPT="ON" +[ "$CLI" != "yes" ] && CLIOPT="OFF" || CLIOPT="ON" +[ "$DAEMON" != "yes" ] && DAEMOPT="OFF" || DAEMOPT="ON" rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT @@ -132,73 +126,43 @@ 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 {} \+ -sed -i -e 's%-g -O3 -funroll-loops %%g' configure.ac -sed -i -e 's%-ggdb3 %%g' configure.ac - -# fix for -current (does no harm on stable). ref: -# https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c13b5e88c6e9c7bd2698d844cb5ed127ed809f7e -rm -f m4/glib-gettext.m4 - -CC=gcc CXX=g++ \ -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --disable-static \ - --verbose \ - --with-gtk=$GTKOPT \ - --${CLIOPT}able-cli \ - --${DAEMOPT}able-daemon \ - --build=$ARCH-slackware-linux \ - --host=$ARCH-slackware-linux - -# Build daemon, GTK and cli client (unless disabled). This also builds -# the tools (transmission-create and friends). -make -make install-strip DESTDIR=$PKG - -if false; then -# As of 3.0.0, transmission-qt can't be built on Slackware 14.2. -# Needs a newer g++ and libstdc++ than we have. -# Left here for reference when 15.0 comes out. -#if [ "$QT" = "yes" ]; then - - # build the Qt client (transmission-qt) unless disabled - # Fix hard-coded path of man file of Qt client - sed -i "s|share/man/|man/|" qt/qtr.pro - - # Needed when using Qt4 - # https://trac.transmissionbt.com/ticket/5700#comment:2 - echo "QMAKE_CXXFLAGS += -std=c++11" >> qt/qtr.pro - - cd $TMP/$PRGNAM-$VERSION/qt - qmake-qt5 \ - QMAKE_CXXFLAGS+="$SLKCFLAGS" \ - QMAKE_CFLAGS+="$SLKCFLAGS" \ - qtr.pro - sed -i -e 's% -g % %g' Makefile - make - INSTALL_ROOT=$PKG/usr make install - - mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps - install -m644 transmission-qt.desktop $PKG/usr/share/applications/transmission-qt.desktop - install -m644 icons/transmission.png $PKG/usr/share/pixmaps/transmission-qt.png - cd - -fi +# 20231219 bkw: make the man pages slightly nicer looking: replace +# 'BSD General Commands Manual' with 'SlackBuilds.org', and replace +# the 'BSD' at the bottom with the version number. +for i in $( find . -maxdepth 2 -name 'transmission*.1' ); do + sed -i -e '/^\.Os/d' \ + -e '/^\.Dt/s,1 *$,\\\&1 "SlackBuilds.org",' \ + -e '/^\.Dt/a.Os '$VERSION \ + $i +done + +mkdir -p build +cd build + cmake \ + -DREBUILD_WEB=OFF \ + -DENABLE_DAEMON=$DAEMOPT \ + -DENABLE_QT=$QTOPT \ + -DENABLE_GTK=$GTKOPT \ + -DENABLE_CLI=$CLIOPT \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DCMAKE_INSTALL_MANDIR=/usr/man \ + -DCMAKE_INSTALL_DOCDIR=/usr/doc/$PRGNAM-$VERSION \ + -DCMAKE_BUILD_TYPE=Release .. + make VERBOSE=1 + make install/strip DESTDIR=$PKG +cd .. gzip -9 $PKG/usr/man/man?/* -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install -#sed "s,@opts@,GTK=$GTK QT=$QT CLI=$CLI DAEMON=$DAEMON," $CWD/slack-desc > $PKG/install/slack-desc -sed "s,@opts@,GTK=$GTK CLI=$CLI DAEMON=$DAEMON," $CWD/slack-desc > $PKG/install/slack-desc +sed "s,@opts@,GTK=$GTK QT=$QT CLI=$CLI DAEMON=$DAEMON," \ + $CWD/slack-desc \ + > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG |