Date: Sun, 25 Jan 2009 20:56:39 +0300 From: Victor Popov <v.a.popov@gmail.com> To: Jeremy Messenger <mezz@FreeBSD.org> Cc: ports@FreeBSD.org Subject: Re: [patch] net-p2p/deluge port improvement - startup scripts + update to 1.1.1 Message-ID: <497CA7D7.6020903@gmail.com> In-Reply-To: <497BE96E.7050004@gmail.com> References: <497BE96E.7050004@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------020801050901090606020204 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello everyone, Replying to myself, sorry. Victor Popov wrote: | Deluge bittorrent client is great, and has a flexible architecture, which | allows user to run a downloading daemon, only occasionally launching an | user interface to manage downloads; all the other time daemon can work | unattended. | net-p2p/deluge port is missing startup scripts for daemon, and this is | what I want to be fixed. | | The attached patch adds two rc scripts, for launching the daemon, deluged, | and for launching deluge in webui mode. Ideally, this should be several | separate ports, like net-p2p/transmission-*, but deluge is installed by | own installer, so dividing port into several would require a lot of work. | | Some comments about why I wrote these startup scripts in this way: | - First of all, I don't at all like the idea of running p2p client as | usual desktop user for security reasons - desktop users may store | sensitive information in their mailboxes, browser configs and other | places, so it is better to dedicate different uid for peering task. This | is why _user and _home configuration variables are introduced. | I wonder, should we assign an uid in the UIDs file? What default homedir | should this user have? I've set default to /home/deluge, and maybe there | are better places? | - Minor bug in launching command-line: it should be --logfile=${logfile}, | not a redirection, but unfortunately it does not work now. Could not | investigate and fix it, sorry. Fixed in new version and handled in updated patch. | - run_rc_command is called with environment variable HOME set to ${home}, | because deluged can't determine homedir from user, and it does not accept | "-c" switch. | - Bug in deluge-webui script: when it is time to stop deluge, script has | to find process due to lack of pidfile. If at that time you are running | deluge with gtk UI, script will find your instance, and will try to kill | it. If deluge_webui_user is not you, it's ok, your deluge is safe, but | after that script will not be able to start webui, because it would think | it is already running. This is because deluge program does not accept | "--pidfile" parameter. There is already a feature-request in deluge | bug-tracker for adding pidfile [http://dev.deluge-torrent.org/ticket/758], | so maybe soon it would be possible to improve this script. | | | Can this patch be commited, please? If something is wrong, comments would | be very appreciated. I've updated my patch to deliver new version of deluge - 1.1.1. In addition to portversion bump and distfile changes, I've changed MASTER_SITES to "official" download site, although it has the same IP now, it can change in future. Also, some plist fixes related to new version. - -- Best regards, Victor Popov mailto:v.a.popov@gmail.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkl8p8oACgkQtKisLOtMPvlKGwCguSKaE0BwjqqkPpAexYo+UsaS emAAoNb+LHfj45BNbU9bAljm1x8WwAev =+WiO -----END PGP SIGNATURE----- --------------020801050901090606020204 Content-Type: text/plain; name="deluge.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="deluge.txt" diff -urN net-p2p/deluge.orig/Makefile net-p2p/deluge/Makefile --- net-p2p/deluge.orig/Makefile 2009-01-19 07:18:08.000000000 +0300 +++ net-p2p/deluge/Makefile 2009-01-25 20:16:45.647549998 +0300 @@ -6,9 +6,9 @@ # PORTNAME= deluge -PORTVERSION= 1.1.0 +PORTVERSION= 1.1.1 CATEGORIES= net-p2p python -MASTER_SITES= http://ftp.osuosl.org/pub/deluge/source/${PORTVERSION}/ +MASTER_SITES= http://download.deluge-torrent.org/source/${PORTVERSION}/ MAINTAINER= mezz@FreeBSD.org COMMENT= A Bittorrent client, using Python, GTK+2 and Rasterbar libtorrent @@ -53,6 +53,11 @@ @${ECHO_CMD} "Keep in mind, choice WITHOUT_PYGTK still will installing a lot of GUI files that are for pygtk. The installation tool does not provide option to disable install the GUI files. These GUI files are harmless as long as you do not touch these or it won't work because it needs pygtk." | ${FMT} 75 75 .endif +USE_RC_SUBR= deluged deluge-webui +SUB_FILES= deluged deluge-webui +SUB_LIST= PYTHON_CMD=${PYTHON_CMD} +PLIST_SUB+= PORTVERSION=${PORTVERSION} + post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g ; \ s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \ diff -urN net-p2p/deluge.orig/distinfo net-p2p/deluge/distinfo --- net-p2p/deluge.orig/distinfo 2009-01-19 07:18:08.000000000 +0300 +++ net-p2p/deluge/distinfo 2009-01-25 19:38:04.190129856 +0300 @@ -1,3 +1,3 @@ -MD5 (deluge-1.1.0.tar.gz) = 22d8016934cc891da4e0b75949681703 -SHA256 (deluge-1.1.0.tar.gz) = b77ea2052ab167ecd46e75ad957891cf95d4e3cc30aa18fc184f0bda17b31efe -SIZE (deluge-1.1.0.tar.gz) = 3055618 +MD5 (deluge-1.1.1.tar.gz) = e4d00f24b94d33e3f02c99361bec57dc +SHA256 (deluge-1.1.1.tar.gz) = 0af39b827ced9af4553879e9751463b0f34c8db8d60c83dc4873ada28d1549c5 +SIZE (deluge-1.1.1.tar.gz) = 3088901 diff -urN net-p2p/deluge.orig/files/deluge-webui.in net-p2p/deluge/files/deluge-webui.in --- net-p2p/deluge.orig/files/deluge-webui.in 1970-01-01 03:00:00.000000000 +0300 +++ net-p2p/deluge/files/deluge-webui.in 2009-01-25 19:56:14.084326235 +0300 @@ -0,0 +1,41 @@ +#!/bin/sh +# +# PROVIDE: deluge_webui +# REQUIRE: LOGIN deluged +# KEYWORD: shutdown +# +# +# Add the following line to /etc/rc.conf to enable the deluge web ui daemon: +# +# deluge_webui_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable deluge web ui daemon. +# deluge_webui_user (str): Defaults to "deluge" +# User running deluge web ui daemon +# deluge_webui_home (str): Defaults to "/home/deluge" +# Directory to store configuration and possibly downloads +# deluge_webui_logfile (str): Defaults to "$deluge_webui_home/deluge_webui.log" +# deluge_webui_loglevel (str): Verbosity of logging, defaults to "error". Possible values: +# none, info, warning, error, critical, debug +# deluge_webui_args (str): Custom additional arguments for deluge, default empty +# + +. %%RC_SUBR%% + +name="deluge_webui" +rcvar=`set_rcvar` + +load_rc_config ${name} +: ${deluge_webui_enable="NO"} +: ${deluge_webui_user="deluge"} +: ${deluge_webui_home="/home/deluge"} +: ${deluge_webui_logfile="${deluge_webui_home}/${name}.log"} +: ${deluge_webui_loglevel="error"} +: ${deluge_webui_args=""} + +required_dirs=${deluge_webui_home} + +command="%%PREFIX%%/bin/deluge" +command_args="--ui=web --loglevel=${deluge_webui_loglevel} --logfile=${deluge_webui_logfile} ${deluge_webui_args} &" +command_interpreter="%%PYTHON_CMD%%" + +HOME=${deluge_webui_home} run_rc_command "$1" diff -urN net-p2p/deluge.orig/files/deluged.in net-p2p/deluge/files/deluged.in --- net-p2p/deluge.orig/files/deluged.in 1970-01-01 03:00:00.000000000 +0300 +++ net-p2p/deluge/files/deluged.in 2009-01-25 19:56:40.615278397 +0300 @@ -0,0 +1,45 @@ +#!/bin/sh +# +# PROVIDE: deluged +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# +# Add the following line to /etc/rc.conf to enable the deluged daemon: +# +# deluged_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable deluged daemon. +# deluged_user (str): Defaults to "deluge" +# User running deluged daemon +# deluged_home (str): Defaults to "/home/deluge" +# Directory to store configuration and possibly downloads +# deluged_pidfile (str): Defaults to "$deluged_home/deluged.pid" +# deluged_logfile (str): Defaults to "$deluged_home/deluged.log" +# deluged_loglevel (str): Verbosity of logging, defaults to "error". Possible values: +# none, info, warning, error, critical, debug +# deluged_args (str): Custom additional arguments for deluged, default empty +# + +. %%RC_SUBR%% + +name="deluged" +rcvar=`set_rcvar` + +# read configuration and set defaults +load_rc_config ${name} +: ${deluged_enable="NO"} +: ${deluged_user="deluge"} +: ${deluged_home="/home/deluge"} +: ${deluged_port="58846"} +: ${deluged_pidfile="${deluged_home}/${name}.pid"} +: ${deluged_logfile="${deluged_home}/${name}.log"} +: ${deluged_loglevel="error"} +: ${deluged_args=""} + +required_dirs=${deluged_home} + +command="%%PREFIX%%/bin/deluged" +command_args="--port=${deluged_port} --pidfile=${deluged_pidfile} --loglevel=${deluged_loglevel} --logfile=${deluged_logfile} ${deluged_args}" +command_interpreter="%%PYTHON_CMD%%" + +HOME=${deluged_home} run_rc_command "$1" diff -urN net-p2p/deluge.orig/pkg-plist net-p2p/deluge/pkg-plist --- net-p2p/deluge.orig/pkg-plist 2009-01-24 05:26:02.775344000 +0300 +++ net-p2p/deluge/pkg-plist 2009-01-25 20:22:56.196856255 +0300 @@ -1,10 +1,10 @@ bin/deluge bin/deluged -%%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info/PKG-INFO -%%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info/SOURCES.txt -%%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info/dependency_links.txt -%%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info/entry_points.txt -%%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info/top_level.txt +%%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info/PKG-INFO +%%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info/SOURCES.txt +%%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info/dependency_links.txt +%%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info/entry_points.txt +%%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info/top_level.txt %%PYTHON_SITELIBDIR%%/deluge/SimpleXMLRPCServer.py %%PYTHON_SITELIBDIR%%/deluge/SimpleXMLRPCServer.pyc %%PYTHON_SITELIBDIR%%/deluge/SimpleXMLRPCServer.pyo @@ -348,6 +348,7 @@ %%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 @@ -390,6 +391,7 @@ %%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/pl/LC_MESSAGES/deluge.mo %%PYTHON_SITELIBDIR%%/deluge/i18n/pms/LC_MESSAGES/deluge.mo %%PYTHON_SITELIBDIR%%/deluge/i18n/pt/LC_MESSAGES/deluge.mo @@ -1073,6 +1075,8 @@ @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/pms @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/pl/LC_MESSAGES @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/pl +@dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/nn/LC_MESSAGES +@dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/nn @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/nl/LC_MESSAGES @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/nl @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/nds/LC_MESSAGES @@ -1155,6 +1159,8 @@ @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/ca @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bs/LC_MESSAGES @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bs +@dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bn/LC_MESSAGES +@dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bn @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bg/LC_MESSAGES @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/bg @dirrm %%PYTHON_SITELIBDIR%%/deluge/i18n/be/LC_MESSAGES @@ -1168,7 +1174,7 @@ @dirrm %%PYTHON_SITELIBDIR%%/deluge/data/pixmaps @dirrm %%PYTHON_SITELIBDIR%%/deluge/data @dirrm %%PYTHON_SITELIBDIR%%/deluge/core -@dirrm %%PYTHON_SITELIBDIR%%/deluge-1.1.0-py2.5.egg-info +@dirrm %%PYTHON_SITELIBDIR%%/deluge-%%PORTVERSION%%-py2.5.egg-info @dirrm %%PYTHON_SITELIBDIR%%/deluge @exec %%LOCALBASE%%/bin/update-desktop-database > /dev/null || /usr/bin/true @unexec %%LOCALBASE%%/bin/update-desktop-database > /dev/null || /usr/bin/true --------------020801050901090606020204--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?497CA7D7.6020903>