Index: head/net-p2p/deluge-cli/Makefile =================================================================== --- head/net-p2p/deluge-cli/Makefile (revision 494742) +++ head/net-p2p/deluge-cli/Makefile (revision 494743) @@ -1,75 +1,75 @@ # $FreeBSD$ PORTNAME= deluge DISTVERSIONPREFIX= ${PORTNAME}- DISTVERSION= 1.3.15 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= net-p2p python PKGNAMESUFFIX= -cli 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@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}libtorrent-rasterbar>=0:net-p2p/py-libtorrent-rasterbar@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}openssl>=0.8:security/py-openssl@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}chardet>=1.0.1:textproc/py-chardet@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}mako>=0.2.5:textproc/py-mako@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}service_identity>=0:security/py-service_identity@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}twisted>=0:devel/py-twisted@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} USES= gettext python:-2.7 USE_PYTHON= autoplist distutils USE_GITHUB= yes GH_ACCOUNT= deluge-torrent NO_ARCH= yes USE_RC_SUBR= deluged deluge_web SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} 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 Index: head/net-p2p/deluge-cli/files/deluge_web.in =================================================================== --- head/net-p2p/deluge-cli/files/deluge_web.in (revision 494742) +++ head/net-p2p/deluge-cli/files/deluge_web.in (revision 494743) @@ -1,82 +1,86 @@ #!/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 + deluge_web_home=$(pw user show ${deluge_web_user} | cut -d : -f 9) + if [ -z ${deluge_web_home} ]; then + err 1 "deluge_web_user does not have a valid home directory." + 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 + if [ ! -d "${deluge_web_home}/.python-eggs" ]; then + mkdir ${deluge_web_home}/.python-eggs + chown -R $deluge_web_user ${deluge_web_home}/.python-eggs 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" + export PYTHON_EGG_CACHE="${deluge_web_home}/.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_confdir:="${deluge_web_home}/.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"