diff options
author | rm <rm@FreeBSD.org> | 2016-10-27 00:52:22 +0800 |
---|---|---|
committer | rm <rm@FreeBSD.org> | 2016-10-27 00:52:22 +0800 |
commit | 85c706d544416cb982b8ebd1af46544288268e51 (patch) | |
tree | 43d979e7eb9aee41564c9e9592a1e22fee151394 /net-p2p/deluge-cli | |
parent | f6ef478fcf57faf50219de60b7432d26d696ca58 (diff) | |
download | freebsd-ports-gnome-85c706d544416cb982b8ebd1af46544288268e51.tar.gz freebsd-ports-gnome-85c706d544416cb982b8ebd1af46544288268e51.tar.zst freebsd-ports-gnome-85c706d544416cb982b8ebd1af46544288268e51.zip |
net-p2p/deluge: split out CLI part
By popular demand split out deluge onto CLI part and GUI part to let users with
headless servers or users who do not want to install all the GTK2 stuff install
just deluge with minimal required dependencies.
deluge-cli port was introduced, that let user to run in CLI mode and to control
the queue via web-interface.
This change requires all the users of net-p2p/deluge to deinstall it first and
then install the required part:
- net-p2p/deluge-cli if GTK2 GUI is not required
- net-p2p/deluge to get the graphical client (net-p2p/deluge-cli will be
installed as a dependency)
Requested by: many
Diffstat (limited to 'net-p2p/deluge-cli')
-rw-r--r-- | net-p2p/deluge-cli/Makefile | 68 | ||||
-rw-r--r-- | net-p2p/deluge-cli/distinfo | 3 | ||||
-rw-r--r-- | net-p2p/deluge-cli/files/deluge_web.in | 82 | ||||
-rw-r--r-- | net-p2p/deluge-cli/files/deluged.in | 81 | ||||
-rw-r--r-- | net-p2p/deluge-cli/files/patch-deluge_core_core.py | 14 | ||||
-rw-r--r-- | net-p2p/deluge-cli/files/patch-setup.py | 18 | ||||
-rw-r--r-- | net-p2p/deluge-cli/pkg-descr | 8 | ||||
-rw-r--r-- | net-p2p/deluge-cli/pkg-plist | 100 |
8 files changed, 374 insertions, 0 deletions
diff --git a/net-p2p/deluge-cli/Makefile b/net-p2p/deluge-cli/Makefile new file mode 100644 index 000000000000..1d4f01fcc503 --- /dev/null +++ b/net-p2p/deluge-cli/Makefile @@ -0,0 +1,68 @@ +# $FreeBSD$ + +PORTNAME= deluge +PORTVERSION= 1.3.13 +PKGNAMESUFFIX= -cli +CATEGORIES= net-p2p python +MASTER_SITES= http://download.deluge-torrent.org/source/ + +MAINTAINER= rm@FreeBSD.org +COMMENT= CLI part of bittorrent client using Python and libtorrent-rasterbar + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= intltool-merge:textproc/intltool +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}xdg>=0.18:devel/py-xdg \ + ${PYTHON_PKGNAMEPREFIX}libtorrent-rasterbar>=0:net-p2p/libtorrent-rasterbar-python \ + ${PYTHON_PKGNAMEPREFIX}openssl>=0.8:security/py-openssl \ + ${PYTHON_PKGNAMEPREFIX}chardet>=1.0.1:textproc/py-chardet \ + ${PYTHON_PKGNAMEPREFIX}mako>=0.2.5:textproc/py-mako + +USE_RC_SUBR= deluged deluge_web +SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} + +NO_ARCH= yes +USES= gettext python:-2.7 tar:xz twisted:run,web +USE_PYTHON= autoplist distutils + +OPTIONS_DEFINE= DOCS + +PORTDOCS= ChangeLog README + +post-patch: + @${REINPLACE_CMD} -e '/"new_release_check":/s|True,|False,|g ; \ + /"geoip_db_location":/s|/usr/share/GeoIP/GeoIP.dat|${LOCALBASE}/share/GeoIP/GeoIP.dat|g' \ + ${WRKSRC}/deluge/core/preferencesmanager.py + @${REINPLACE_CMD} -e '/"check_new_releases":/s|True,|False,|g ; \ + /"show_new_releases":/s|True,|False,|g' \ + ${WRKSRC}/deluge/ui/gtkui/gtkui.py + +post-install: +# do these by hand, else they wind up in the wrong place + @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps ; \ + ${INSTALL_DATA} ${WRKSRC}/deluge/data/icons/scalable/apps/deluge.svg \ + ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps +.for size in 16 22 24 32 36 48 64 72 96 128 192 256 + @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${size}x${size}/apps ; \ + ${INSTALL_DATA} ${WRKSRC}/deluge/data/icons/hicolor/${size}x${size}/apps/deluge.png \ + ${STAGEDIR}${PREFIX}/share/icons/hicolor/${size}x${size}/apps +.endfor +.for pic in png xpm + ${INSTALL_DATA} ${WRKSRC}/deluge/data/pixmaps/deluge.${pic} \ + ${STAGEDIR}${PREFIX}/share/pixmaps +.endfor + +# install man pages +.for man in deluge.1 deluge-console.1 deluge-gtk.1 deluge-web.1 deluged.1 + ${INSTALL_MAN} ${WRKSRC}/docs/man/${man} ${STAGEDIR}${MANPREFIX}/man/man1/ +.endfor + + ${INSTALL_DATA} ${WRKSRC}/deluge/data/share/applications/deluge.desktop \ + ${STAGEDIR}${PREFIX}/share/applications + +post-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> diff --git a/net-p2p/deluge-cli/distinfo b/net-p2p/deluge-cli/distinfo new file mode 100644 index 000000000000..0b23eeba0e2e --- /dev/null +++ b/net-p2p/deluge-cli/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1469200565 +SHA256 (deluge-1.3.13.tar.xz) = fe8059a66834abd656693a8736b0829cb3342bb803c55384abad3756097d394e +SIZE (deluge-1.3.13.tar.xz) = 1460948 diff --git a/net-p2p/deluge-cli/files/deluge_web.in b/net-p2p/deluge-cli/files/deluge_web.in new file mode 100644 index 000000000000..63962d773ac3 --- /dev/null +++ b/net-p2p/deluge-cli/files/deluge_web.in @@ -0,0 +1,82 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: deluge_web +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# MANDATORY: +# +# deluge_web_enable (bool): Set to NO by default. +# Set it to YES to enable deluge_web. +# +# deluge_web_user (str): The UNPRIVILEGED user to run as +# +# OPTIONAL: +# +# deluge_web_flags (str): Set as needed +# See deluge-web(1) for more information +# +# deluge_web_confdir (path): Set to /home/$deluge_web_user/.config/deluge +# by default +# +# deluge_web_loglevel (str): Set to "error" by default +# +# deluge_web_logfile (path): Set to /var/tmp/deluge_web.log by default + +. /etc/rc.subr + +name="deluge_web" +rcvar=${name}_enable + +command=%%PREFIX%%/bin/deluge-web +command_interpreter=%%PYTHON_CMD%% + +start_precmd=${name}_prestart +stop_postcmd=${name}_poststop + +deluge_web_prestart() +{ + if [ "$deluge_web_user" = 'asjklasdfjklasdf' ]; then + err 1 "You must set deluge_web_user to a real, unprivileged user" + fi + + if [ ! -d "/var/run/${name}" ]; then + if [ -e "/var/run/${name}" ]; then + unlink /var/run/${name} + fi + mkdir -p /var/run/${name} + fi + + if [ ! -d "/home/${deluge_web_user}/.python-eggs" ]; then + mkdir -p /home/${deluge_web_user}/.python-eggs + fi + + chmod 0755 /var/run/${name} + chown -R $deluge_web_user /var/run/${name} + chown -R $deluge_web_user /home/${deluge_web_user}/.python-eggs + export PYTHON_EGG_CACHE="/home/${deluge_web_user}/.python-eggs" +} + +deluge_web_poststop() +{ + [ -e "$deluge_web_logfile" -a ! -s "$deluge_web_logfile" ] && + unlink $deluge_web_logfile +} + +load_rc_config $name + +: ${deluge_web_enable:="NO"} +: ${deluge_web_user:="asjklasdfjklasdf"} +: ${deluge_web_confdir:="/home/${deluge_web_user}/.config/deluge"} +: ${deluge_web_loglevel:="error"} +: ${deluge_web_logfile:="/var/tmp/${name}.log"} + +required_dirs="$deluge_web_confdir" +command_args="-f -c $required_dirs -L $deluge_web_loglevel -l $deluge_web_logfile" + +run_rc_command "$1" diff --git a/net-p2p/deluge-cli/files/deluged.in b/net-p2p/deluge-cli/files/deluged.in new file mode 100644 index 000000000000..67c505852f3c --- /dev/null +++ b/net-p2p/deluge-cli/files/deluged.in @@ -0,0 +1,81 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: deluged +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# MANDATORY: +# +# deluged_enable (bool): Set to NO by default. +# Set it to YES to enable deluged. +# +# deluged_user (str): The UNPRIVILEGED user to run as +# +# OPTIONAL: +# +# deluged_flags (str): Set as needed +# See deluged(1) for more information +# +# deluged_confdir (path): Set to /home/$deluged_user/.config/deluge +# by default +# +# deluged_loglevel (str): Set to "error" by default +# +# deluged_logfile (path): Set to /var/tmp/deluged.log by default + +. /etc/rc.subr + +name="deluged" +rcvar=deluged_enable + +command=%%PREFIX%%/bin/${name} +command_interpreter=%%PYTHON_CMD%% + +pidfile=/var/run/${name}/pid + +start_precmd=${name}_prestart +stop_postcmd=${name}_poststop + +deluged_prestart() +{ + if [ "$deluged_user" = 'asjklasdfjklasdf' ]; then + err 1 "You must set deluged_user to a real, unprivileged user" + fi + + if [ ! -d "/var/run/${name}" ]; then + if [ -e "/var/run/${name}" ]; then + unlink /var/run/${name} + fi + mkdir -p /var/run/${name} + fi + + chmod 0755 /var/run/${name} + chown -R $deluged_user /var/run/${name} +} + +deluged_poststop() +{ + [ -e "$pidfile" ] && unlink $pidfile + [ -d "${pidfile%/pid}" ] && rmdir ${pidfile%/pid} + + [ -e "$deluged_logfile" -a ! -s "$deluged_logfile" ] && + unlink $deluged_logfile +} + +load_rc_config $name + +: ${deluged_enable:="NO"} +: ${deluged_user:="asjklasdfjklasdf"} +: ${deluged_confdir:="/home/${deluged_user}/.config/deluge"} +: ${deluged_loglevel:="error"} +: ${deluged_logfile:="/var/tmp/${name}.log"} + +required_dirs="$deluged_confdir" +command_args="-c $required_dirs -L $deluged_loglevel -l $deluged_logfile -P $pidfile" + +run_rc_command "$1" diff --git a/net-p2p/deluge-cli/files/patch-deluge_core_core.py b/net-p2p/deluge-cli/files/patch-deluge_core_core.py new file mode 100644 index 000000000000..d7b2e29ba71c --- /dev/null +++ b/net-p2p/deluge-cli/files/patch-deluge_core_core.py @@ -0,0 +1,14 @@ +This patch fixes upload rate speed problem discussed here: +http://forum.deluge-torrent.org/viewtopic.php?f=7&t=33839 + +--- deluge/core/core.py.orig 2014-07-09 19:08:22 UTC ++++ deluge/core/core.py +@@ -93,7 +93,7 @@ + self.__load_session_state() + + # Set the user agent +- self.settings = lt.session_settings() ++ self.settings = lt.high_performance_seed() + self.settings.user_agent = "Deluge %s" % deluge.common.get_version() + # Increase the alert queue size so that alerts don't get lost + self.settings.alert_queue_size = 10000 diff --git a/net-p2p/deluge-cli/files/patch-setup.py b/net-p2p/deluge-cli/files/patch-setup.py new file mode 100644 index 000000000000..d177e1795802 --- /dev/null +++ b/net-p2p/deluge-cli/files/patch-setup.py @@ -0,0 +1,18 @@ +--- setup.py.orig 2016-07-20 14:23:28 UTC ++++ setup.py +@@ -215,6 +215,7 @@ except ImportError: + build_libtorrent = True + else: + build_libtorrent = False ++build_libtorrent = False + + if build_libtorrent: + got_libtorrent = False +@@ -515,6 +516,7 @@ if not windows_check() and not osx_check + + if os.path.exists(desktop_data): + _data_files.append(('share/applications', [desktop_data])) ++ _data_files = [] + + entry_points = { + "console_scripts": [ diff --git a/net-p2p/deluge-cli/pkg-descr b/net-p2p/deluge-cli/pkg-descr new file mode 100644 index 000000000000..e006cdc2016c --- /dev/null +++ b/net-p2p/deluge-cli/pkg-descr @@ -0,0 +1,8 @@ +Deluge is a Bittorrent client written in Python and GTK+. Deluge is intended +to bring a native, full-featured client to Linux, BSD, and other *nix GTK +desktop environments such as Gnome and Xfce. + +Deluge uses Rasterbar's version of libtorrent as the main ingredient in its +bittorrent protocol backend. + +WWW: http://deluge-torrent.org/ diff --git a/net-p2p/deluge-cli/pkg-plist b/net-p2p/deluge-cli/pkg-plist new file mode 100644 index 000000000000..bb7ab7cd0428 --- /dev/null +++ b/net-p2p/deluge-cli/pkg-plist @@ -0,0 +1,100 @@ +%%PYTHON_SITELIBDIR%%/deluge/i18n/af/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ar/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ast/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/be/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/bg/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/bn/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/bs/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ca/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/cs/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/cy/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/da/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/de/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/el/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/en_AU/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/en_CA/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/en_GB/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/eo/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/es/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/et/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/eu/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/fa/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/fi/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/fo/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/fr/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/fy/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ga/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/gl/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/he/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/hi/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/hr/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/hu/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/id/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/is/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/it/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/iu/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ja/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ka/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/kk/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/km/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/kn/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ko/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ku/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ky/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/la/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/lb/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/lt/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/lv/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/mk/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ml/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ms/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/nap/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/nb/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/nds/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/nl/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/nn/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/oc/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/pl/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/pms/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/pt/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/pt_BR/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ro/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ru/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/si/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/sk/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/sl/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/sr/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/sv/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ta/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/te/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/th/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/tl/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/tlh/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/tr/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/uk/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/ur/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/vi/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/zh_CN/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/zh_HK/LC_MESSAGES/deluge.mo +%%PYTHON_SITELIBDIR%%/deluge/i18n/zh_TW/LC_MESSAGES/deluge.mo +man/man1/deluge.1.gz +man/man1/deluge-console.1.gz +man/man1/deluge-gtk.1.gz +man/man1/deluge-web.1.gz +man/man1/deluged.1.gz +share/applications/deluge.desktop +share/icons/hicolor/128x128/apps/deluge.png +share/icons/hicolor/16x16/apps/deluge.png +share/icons/hicolor/192x192/apps/deluge.png +share/icons/hicolor/22x22/apps/deluge.png +share/icons/hicolor/24x24/apps/deluge.png +share/icons/hicolor/256x256/apps/deluge.png +share/icons/hicolor/32x32/apps/deluge.png +share/icons/hicolor/36x36/apps/deluge.png +share/icons/hicolor/48x48/apps/deluge.png +share/icons/hicolor/64x64/apps/deluge.png +share/icons/hicolor/72x72/apps/deluge.png +share/icons/hicolor/96x96/apps/deluge.png +share/icons/hicolor/scalable/apps/deluge.svg +share/pixmaps/deluge.png +share/pixmaps/deluge.xpm |