From 944eea682e1f16d0ec0a313af746c38833fd9117 Mon Sep 17 00:00:00 2001 From: feld Date: Tue, 8 Mar 2016 16:40:00 +0000 Subject: news/sabnzbdplus: Port cleanup - Better define which versions of python sabnzbd can actually run with - Remove "+" sign from SUB_LIST - Modernize OPTION RUN_DEPENDS - Do not set PATH in rc script - Make patch and reinplace more logical by not replacing %%PREFIX%% with %%DATADIR%% - Remove creation of PREFIX/sabnzbd (sabznzbd's config directory) from install as it is already handled in start_precmd routine - Replace INSTALL_DATA with INSTALL_MAN for installing PORTDOCS - Hand off maintainership PR: 207583 --- news/sabnzbdplus/Makefile | 36 ++++++++++----------------------- news/sabnzbdplus/files/patch-SABnzbd.py | 4 ++-- news/sabnzbdplus/files/sabnzbd.in | 1 - news/sabnzbdplus/pkg-plist | 1 - 4 files changed, 13 insertions(+), 29 deletions(-) (limited to 'news') diff --git a/news/sabnzbdplus/Makefile b/news/sabnzbdplus/Makefile index 5f39641a0791..7fddbdd7f286 100644 --- a/news/sabnzbdplus/Makefile +++ b/news/sabnzbdplus/Makefile @@ -2,11 +2,12 @@ PORTNAME= sabnzbdplus PORTVERSION= 0.7.20 +PORTREVISION= 1 CATEGORIES= news MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTVERSION} DISTNAME= SABnzbd-${PORTVERSION}-src -MAINTAINER= feld@FreeBSD.org +MAINTAINER= joshruehlig@gmail.com COMMENT= Web-interface based binary newsgrabber in python, with nzb support LICENSE= BSD2CLAUSE BSD3CLAUSE GPLv2 GPLv3 ISCL MIT PSFL @@ -16,12 +17,12 @@ RUN_DEPENDS= cheetah:${PORTSDIR}/devel/py-cheetah \ ${PYTHON_SITELIBDIR}/pythonutils/configobj.py:${PORTSDIR}/devel/py-utils \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 -USES= gettext python +USES= gettext python:2.5-2.7 NO_BUILD= yes WRKSRC= ${WRKDIR}/SABnzbd-${PORTVERSION} PLIST_SUB= PORTNAME=${PORTNAME} -SUB_LIST+= PORTNAME=${PORTNAME} PYTHON_CMD=${PYTHON_CMD} +SUB_LIST= PORTNAME=${PORTNAME} PYTHON_CMD=${PYTHON_CMD} SUB_FILES= pkg-message USE_RC_SUBR= sabnzbd @@ -44,30 +45,16 @@ YENC_DESC= yenc support .include -.if ${PORT_OPTIONS:MPAR2CMDLINE} -RUN_DEPENDS+= par2repair:${PORTSDIR}/archivers/par2cmdline-tbb -.endif - -.if ${PORT_OPTIONS:MFEEDPARSER} -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}feedparser>=0:${PORTSDIR}/textproc/py-feedparser -.endif - -.if ${PORT_OPTIONS:MYENC} -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}yenc>=0:${PORTSDIR}/news/py-yenc -.endif - -.if ${PORT_OPTIONS:MOPENSSL} -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}openssl>=0:${PORTSDIR}/security/py-openssl -.endif - -.if ${PORT_OPTIONS:MUNRAR} -RUN_DEPENDS+= unrar:${PORTSDIR}/archivers/unrar -.endif +PAR2CMDLINE_RUN_DEPENDS= par2repair:${PORTSDIR}/archivers/par2cmdline-tbb +FEEDPARSER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}feedparser>=0:${PORTSDIR}/textproc/py-feedparser +YENC_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yenc>=0:${PORTSDIR}/news/py-yenc +OPENSSL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}openssl>=0:${PORTSDIR}/security/py-openssl +UNRAR_RUN_DEPENDS= unrar:${PORTSDIR}/archivers/unrar post-patch: @${REINPLACE_CMD} -e "s:/usr/bin/python:${PYTHON_CMD}:g" \ ${WRKSRC}/SABnzbd.py - @${REINPLACE_CMD} -e "s:%%PREFIX%%:'${DATADIR}':g" \ + @${REINPLACE_CMD} -e "s:%%DATADIR%%:'${DATADIR}':g" \ ${WRKSRC}/SABnzbd.py # the NO_BUILD option stops execution after configure. This should really be @@ -77,7 +64,6 @@ do-install: ${INSTALL} -d ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/sabnzbd cd ${WRKSRC}/sabnzbd && ${COPYTREE_SHARE} \* ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/sabnzbd ${INSTALL} -d ${STAGEDIR}${DATADIR} - ${INSTALL} -d ${STAGEDIR}${PREFIX}/sabnzbd .for i in cherrypy gntp interfaces locale po tools util ${MKDIR} ${STAGEDIR}${DATADIR}/${i} cd ${WRKSRC}/${i} && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/${i} @@ -86,7 +72,7 @@ do-install: .if ${PORT_OPTIONS:MDOCS} ${MKDIR} ${STAGEDIR}${DOCSDIR} .for i in ${PORTDOCS} - ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} + ${INSTALL_MAN} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} .endfor .endif diff --git a/news/sabnzbdplus/files/patch-SABnzbd.py b/news/sabnzbdplus/files/patch-SABnzbd.py index d755d4754e84..5eb452b146a8 100644 --- a/news/sabnzbdplus/files/patch-SABnzbd.py +++ b/news/sabnzbdplus/files/patch-SABnzbd.py @@ -6,7 +6,7 @@ +# Force python to load the patched version of cherrypy included with the port, +# instead of any version that may be installed otherwise. -+sys.path.insert(0,%%PREFIX%%) ++sys.path.insert(0,%%DATADIR%%) import cherrypy if not cherrypy.__version__.startswith("3.2"): print "Sorry, requires Python module Cherrypy 3.2 (use the included version)" @@ -15,7 +15,7 @@ sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sabnzbd.MY_FULLNAME)) sabnzbd.MY_NAME = os.path.basename(sabnzbd.MY_FULLNAME) - sabnzbd.DIR_PROG = os.path.dirname(sabnzbd.MY_FULLNAME) -+ sabnzbd.DIR_PROG = %%PREFIX%% ++ sabnzbd.DIR_PROG = %%DATADIR%% sabnzbd.DIR_INTERFACES = real_path(sabnzbd.DIR_PROG, DEF_INTERFACES) sabnzbd.DIR_LANGUAGE = real_path(sabnzbd.DIR_PROG, DEF_LANGUAGE) org_dir = os.getcwd() diff --git a/news/sabnzbdplus/files/sabnzbd.in b/news/sabnzbdplus/files/sabnzbd.in index c00f110a683d..37625ffa54f8 100644 --- a/news/sabnzbdplus/files/sabnzbd.in +++ b/news/sabnzbdplus/files/sabnzbd.in @@ -46,7 +46,6 @@ command_args="--daemon -f ${sabnzbd_conf_dir}/sabnzbd.ini --pidfile ${pidfile}" sabnzbd_prestart() { - PATH=${PATH}:/usr/local/bin:/usr/local/sbin for sabdir in ${sabnzbd_conf_dir} ${pidfile%/*}; do if [ ! -d "${sabdir}" ]; then install -d -o ${sabnzbd_user} -g ${sabnzbd_group} ${sabdir} diff --git a/news/sabnzbdplus/pkg-plist b/news/sabnzbdplus/pkg-plist index 73e8078281a8..7adc3dc4e35a 100644 --- a/news/sabnzbdplus/pkg-plist +++ b/news/sabnzbdplus/pkg-plist @@ -422,4 +422,3 @@ bin/SABnzbd.py %%DATADIR%%/util/apireg.py %%DATADIR%%/util/mailslot.py %%DATADIR%%/util/pystone.py -@dir(_sabnzbd,_sabnzbd,755) sabnzbd -- cgit