net-p2p/deluge: support staging and more
- do not use easy_install and convert to auto-generated plist - add staging support - convert USE_XZ to USES - Makefile clean-up - add startup script for deluge-web [1] PR: 185888 Reported by: huber.georg@gmail.com Submitted by: Daniel O'Connor <darius@dons.net.au> (private email) [1] - fix compatibility issue with twisted > 13.1.0, that prevents BlockList plugin from work correctly [2] PR: 189497 Submitted by: George Amanakis <g_amanakis@yahoo.com> [2]
This commit is contained in:
parent
dd5e466c72
commit
f05c0d9ec0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=356620
4 changed files with 129 additions and 1567 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
PORTNAME= deluge
|
||||
PORTVERSION= 1.3.6
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= net-p2p python
|
||||
MASTER_SITES= http://download.deluge-torrent.org/source/
|
||||
|
@ -19,43 +19,23 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}xdg>=0.18:${PORTSDIR}/devel/py-xdg \
|
|||
${PYTHON_PKGNAMEPREFIX}chardet>=1.0.1:${PORTSDIR}/textproc/py-chardet \
|
||||
${PYTHON_PKGNAMEPREFIX}mako>=0.2.5:${PORTSDIR}/textproc/py-mako
|
||||
|
||||
USE_RC_SUBR= deluged
|
||||
USE_RC_SUBR= deluged deluge_web
|
||||
SUB_LIST+= PYTHON_CMD=${PYTHON_CMD}
|
||||
PLIST_SUB+= PYTHON_VER=${PYTHON_VER}
|
||||
|
||||
USE_XZ= yes
|
||||
WANT_GNOME= yes
|
||||
USES= gettext twisted:run,web
|
||||
USES= gettext tar:xz twisted:run,web
|
||||
USE_OPENSSL= yes
|
||||
USE_PYTHON= 2
|
||||
USE_PYDISTUTILS= easy_install
|
||||
PYDISTUTILS_BUILD_TARGET= build bdist_egg
|
||||
USE_PYDISTUTILS= yes
|
||||
PYDISTUTILS_AUTOPLIST= yes
|
||||
|
||||
OPTIONS_DEFINE= GTK2
|
||||
OPTIONS_DEFAULT=GTK2
|
||||
|
||||
MAN1= deluge.1 deluge-console.1 deluge-gtk.1 deluge-web.1 deluged.1
|
||||
PORTDOCS= ChangeLog README
|
||||
|
||||
PORTDOCS= *
|
||||
|
||||
NO_STAGE= yes
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
# things that happen when PREFIX differs from LOCALBASE
|
||||
.if ${PREFIX} != ${LOCALBASE}
|
||||
|
||||
# only touch easy-install.pth if we installed it ourselves
|
||||
.if !exists(${PYTHONPREFIX_SITELIBDIR}/easy-install.pth)
|
||||
PLIST_FILES+= ${PYTHON_SITELIBDIR:S;${LOCALBASE}/;;}/easy-install.pth
|
||||
.endif
|
||||
|
||||
# only touch site.py{c,o} if we installed it ourselves
|
||||
.for file in site.py site.pyc site.pyo
|
||||
.if !exists(${PYTHONPREFIX_SITELIBDIR}/${file})
|
||||
PLIST_FILES+= ${PYTHON_SITELIBDIR:S;${LOCALBASE}/;;}/${file}
|
||||
.endif
|
||||
.endfor
|
||||
.endif
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MGTK2}
|
||||
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dbus>=0.83:${PORTSDIR}/devel/py-dbus \
|
||||
|
@ -63,12 +43,9 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dbus>=0.83:${PORTSDIR}/devel/py-dbus \
|
|||
${PYTHON_PKGNAMEPREFIX}notify>=0.1.1:${PORTSDIR}/devel/py-notify \
|
||||
xdg-utils>=1.0.2:${PORTSDIR}/devel/xdg-utils
|
||||
|
||||
PLIST_SUB+= PYGTK=""
|
||||
USE_GNOME+= librsvg2 pygtk2
|
||||
USES+= desktop-file-utils
|
||||
INSTALLS_ICONS= yes
|
||||
.else
|
||||
PLIST_SUB+= PYGTK="@comment "
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
|
@ -83,33 +60,28 @@ post-patch:
|
|||
|
||||
post-install:
|
||||
# do these by hand, else they wind up in the wrong place
|
||||
${MKDIR} ${PREFIX}/share/icons/hicolor/scalable/apps ; \
|
||||
@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps ; \
|
||||
${INSTALL_DATA} ${WRKSRC}/deluge/data/icons/scalable/apps/deluge.svg \
|
||||
${PREFIX}/share/icons/hicolor/scalable/apps
|
||||
${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
|
||||
.for size in 16 22 24 32 36 48 64 72 96 128 192 256
|
||||
${MKDIR} ${PREFIX}/share/icons/hicolor/${size}x${size}/apps ; \
|
||||
@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${size}x${size}/apps ; \
|
||||
${INSTALL_DATA} ${WRKSRC}/deluge/data/icons/hicolor/${size}x${size}/apps/deluge.png \
|
||||
${PREFIX}/share/icons/hicolor/${size}x${size}/apps
|
||||
${STAGEDIR}${PREFIX}/share/icons/hicolor/${size}x${size}/apps
|
||||
.endfor
|
||||
.for file in png xpm
|
||||
${INSTALL_DATA} ${WRKSRC}/deluge/data/pixmaps/deluge.${file} \
|
||||
${PREFIX}/share/pixmaps
|
||||
.for pic in png xpm
|
||||
${INSTALL_DATA} ${WRKSRC}/deluge/data/pixmaps/deluge.${pic} \
|
||||
${STAGEDIR}${PREFIX}/share/pixmaps
|
||||
.endfor
|
||||
.if ${PORT_OPTIONS:MGTK2}
|
||||
${INSTALL_DATA} ${WRKSRC}/deluge/data/share/applications/deluge.desktop \
|
||||
${PREFIX}/share/applications
|
||||
${STAGEDIR}${PREFIX}/share/applications
|
||||
.endif
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
${MKDIR} ${DOCSDIR}
|
||||
.for i in ChangeLog README
|
||||
${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
|
||||
.endfor
|
||||
.endif
|
||||
# install man pages
|
||||
.for man in ${MAN1}
|
||||
${INSTALL_MAN} ${WRKSRC}/docs/man/${man} ${MANPREFIX}/man/man1/
|
||||
.endfor
|
||||
# fix installation permissions
|
||||
@${FIND} ${PYTHONPREFIX_SITELIBDIR}/${PYEASYINSTALL_EGG} -type f -exec ${CHMOD} ${SHAREMODE} {} \;
|
||||
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
||||
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
# 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
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
76
net-p2p/deluge/files/deluge_web.in
Normal file
76
net-p2p/deluge/files/deluge_web.in
Normal file
|
@ -0,0 +1,76 @@
|
|||
#!/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/${name}
|
||||
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
|
||||
|
||||
chmod 0755 /var/run/${name}
|
||||
chown -R $deluge_web_user /var/run/${name}
|
||||
}
|
||||
|
||||
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"
|
21
net-p2p/deluge/files/patch-deluge_httpdownloader.py
Normal file
21
net-p2p/deluge/files/patch-deluge_httpdownloader.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
--- ./deluge/httpdownloader.py.orig 2013-02-25 21:01:07.000000000 +0400
|
||||
+++ ./deluge/httpdownloader.py 2014-06-05 12:56:06.000000000 +0400
|
||||
@@ -192,7 +192,17 @@
|
||||
headers = {}
|
||||
headers["accept-encoding"] = "deflate, gzip, x-gzip"
|
||||
|
||||
- scheme, host, port, path = client._parse(url)
|
||||
+ # In twisted 13.1.0 the _parse() function was replaced by the _URI class
|
||||
+ if hasattr(client, '_parse'):
|
||||
+ scheme, host, port, path = client._parse(url)
|
||||
+ else:
|
||||
+ from twisted.web.client import _URI
|
||||
+ uri = _URI.fromBytes(url)
|
||||
+ scheme = uri.scheme
|
||||
+ host = uri.host
|
||||
+ port = uri.port
|
||||
+ path = uri.path
|
||||
+
|
||||
factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
|
||||
if scheme == "https":
|
||||
from twisted.internet import ssl
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue