diff options
-rw-r--r-- | network/qbittorrent-qt5/README | 2 | ||||
-rw-r--r-- | network/qbittorrent-qt5/README.SBo | 17 | ||||
-rw-r--r-- | network/qbittorrent-qt5/doinst.sh | 24 | ||||
-rw-r--r-- | network/qbittorrent-qt5/qbittorrent-qt5.SlackBuild | 111 | ||||
-rw-r--r-- | network/qbittorrent-qt5/qbittorrent-qt5.info | 10 | ||||
-rw-r--r-- | network/qbittorrent-qt5/rc.qbittorrent-nox.new | 82 | ||||
-rw-r--r-- | network/qbittorrent-qt5/slack-desc | 19 |
7 files changed, 265 insertions, 0 deletions
diff --git a/network/qbittorrent-qt5/README b/network/qbittorrent-qt5/README new file mode 100644 index 0000000000..c56a8977ce --- /dev/null +++ b/network/qbittorrent-qt5/README @@ -0,0 +1,2 @@ +qBittorrent is an easy to use, good looking, and featureful +but lightweight C++ / Qt5 Bittorrent Client. diff --git a/network/qbittorrent-qt5/README.SBo b/network/qbittorrent-qt5/README.SBo new file mode 100644 index 0000000000..15193a85ab --- /dev/null +++ b/network/qbittorrent-qt5/README.SBo @@ -0,0 +1,17 @@ +An rc init script is provided and has the following features: + +Runs qbittorrent-nox webui under user who started the script. + +Usage: +/etc/rc.d/rc.qbittorrent-nox start [PORT]|stop|restart [PORT]|status +Port defaults to 8080 if not provided. + +To run this script from rc.local you must run it as a non-root user. + +Example: +/bin/su - david -c /etc/rc.d/rc.qbittorrent-nox start 9000 + +Program output is sent to /tmp/qbittorrent-nox-$USER + +The status command can be run as root, in which case you should see +all process of qbittorrent-nox, otherwise you will just see $USER's. diff --git a/network/qbittorrent-qt5/doinst.sh b/network/qbittorrent-qt5/doinst.sh new file mode 100644 index 0000000000..d3350f3157 --- /dev/null +++ b/network/qbittorrent-qt5/doinst.sh @@ -0,0 +1,24 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/rc.d/rc.qbittorrent-nox.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/network/qbittorrent-qt5/qbittorrent-qt5.SlackBuild b/network/qbittorrent-qt5/qbittorrent-qt5.SlackBuild new file mode 100644 index 0000000000..217b32606d --- /dev/null +++ b/network/qbittorrent-qt5/qbittorrent-qt5.SlackBuild @@ -0,0 +1,111 @@ +#!/bin/sh + +# Slackware build script for qbittorrent-qt5 + +# Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=qbittorrent-qt5 +SRCNAM=qbittorrent +VERSION=${VERSION:-3.3.10} +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 $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.?z* +cd $SRCNAM-$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 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr + +make +make install INSTALL_ROOT=$PKG +make clean + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --disable-gui + +make +mv src/qbittorrent-nox $PKG/usr/bin + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mv $PKG/usr/share/man $PKG/usr +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 + +mkdir -p $PKG/etc/rc.d +cp $CWD/rc.qbittorrent-nox.new $PKG/etc/rc.d/. + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS Changelog NEWS TODO COPYING INSTALL README.md \ + $CWD/README.SBo $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $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} diff --git a/network/qbittorrent-qt5/qbittorrent-qt5.info b/network/qbittorrent-qt5/qbittorrent-qt5.info new file mode 100644 index 0000000000..9c702e0c80 --- /dev/null +++ b/network/qbittorrent-qt5/qbittorrent-qt5.info @@ -0,0 +1,10 @@ +PRGNAM="qbittorrent-qt5" +VERSION="3.3.10" +HOMEPAGE="http://qbittorrent.sourceforge.net" +DOWNLOAD="http://downloads.sourceforge.net/qbittorrent/qbittorrent-3.3.10.tar.xz" +MD5SUM="47497bf0fb27ad54efde2bcd5c549e5b" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libtorrent-rasterbar qt5 libinput" +MAINTAINER="David Woodfall" +EMAIL="dave@dawoodfall.net" diff --git a/network/qbittorrent-qt5/rc.qbittorrent-nox.new b/network/qbittorrent-qt5/rc.qbittorrent-nox.new new file mode 100644 index 0000000000..f2c3c6218b --- /dev/null +++ b/network/qbittorrent-qt5/rc.qbittorrent-nox.new @@ -0,0 +1,82 @@ +#!/bin/sh + +# /etc/rc.d/rc.qbittorrent-nox +# Runs qbittorrent webui under user who started the script. +# Usage: /etc/rc.d/rc.qbittorrent-nox start <PORT>|stop|restart <PORT>|status +# Port defaults to 8080 if not provided. +# +# To run this script from rc.local you must run it as a non-root user. +# +# Example: +# /bin/su - david -c /etc/rc.d/rc.qbittorrent-nox start 9000 +# Program output is sent to /tmp/qbittorrent-nox-$USER + +# First some checks to see what's what. + +if [ "$USER" = "root" ] && [ "$1" = "start" ]; then + echo "Do not start the daemon as root." >/dev/stderr + exit 1 +fi + + +if [ -n "$2" ]; then + UIPORT="$2" +else + UIPORT="8080" +fi + +LOG="/tmp/qbittorrent-nox-$USER" +APP="/usr/bin/qbittorrent-nox" + +do_start() +{ + if [ -n "$(/bin/netstat -nta | awk '{print $4}' \ + | cut -d: -f2 | grep $UIPORT | grep 0.0.0.0)" ]; then + + echo "Port $UIPORT is already in use." >/dev/stderr + exit 1 + fi + + $APP --webui-port=$UIPORT 1>$LOG 2>&1 & +} + +do_stop() +{ + PID="$(pgrep -u $USER qbittorrent-nox)" + + if [ -n "$PID" ]; then + echo "Killing PID $PID" + kill $PID + else + echo "No process found." >/dev/stderr + fi +} + +do_status() +{ + echo "Local Address Foreign Address State PID/Program name" + /bin/netstat -pntl 2>&1 | grep qbittorrent-n \ + | awk '{print $4 " " $5 " " $6 " " $7}' +} + +case "$1" in + 'start') + do_start + ;; + + 'stop') + do_stop + ;; + 'restart') + do_stop + sleep 1 + do_start + ;; + 'status') + do_status + ;; + *) + echo "Usage: $0 {start <PORT>|stop|restart <PORT>|status}" >/dev/stderr + exit 1 + ;; +esac diff --git a/network/qbittorrent-qt5/slack-desc b/network/qbittorrent-qt5/slack-desc new file mode 100644 index 0000000000..27dd1cf3b5 --- /dev/null +++ b/network/qbittorrent-qt5/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +qbittorrent-qt5: qbittorrent (a C++ / Qt5 Bittorrent Client) +qbittorrent-qt5: +qbittorrent-qt5: The qBittorrent project was created in March 2006 with the idea +qbittorrent-qt5: of developing a new Bittorrent client for Linux (and possibly +qbittorrent-qt5: other systems) that would be easy to use, good looking, and +qbittorrent-qt5: featureful but lightweight. +qbittorrent-qt5: qBittorrent is a Free Software released under the GNU GPL license. +qbittorrent-qt5: The author is Christophe Dumez, a French student in an engineer +qbittorrent-qt5: school (UTBM), in IT departement. +qbittorrent-qt5: +qbittorrent-qt5: Homepage: http://qbittorrent.sourceforge.net |