From bd20cbacf217da5e17ecdd0e82647b9ccd5ca2d3 Mon Sep 17 00:00:00 2001 From: Kai Knoblich Date: Sun, 23 Jun 2019 22:38:05 +0000 Subject: MFH: r504995 deskutils/conkyemail: Fix invocation of Python script at runtime Since the default version of Python has been switched to 3.6 in r498529 the script "conkyEmail.py" that is invoked by the shell script "conkyEmail" fails at runtime due incompatible code. This occurs only if the Python meta port is also installed otherwise it won't start at all due a hardcoded reference (= /usr/bin/env python) in the shell script, thus: * Update and simplify the patch for "conkyEmail" by using placeholders for the Python interpreter and ${DATADIR} that will be replaced by the post-patch target. [1] Also while I'm here: * Silence all commands of the post-patch target to reduce cluttering of logfiles * Add license information * Pet portlint PR: 238487 Submitted by: Katsuyuki Miyoshi (initial patch) Approved by: ports-secteam (blanket: runtime fix, framework compliance) --- deskutils/conkyemail/Makefile | 11 +++++++++-- deskutils/conkyemail/files/patch-conkyEmail | 9 +++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/deskutils/conkyemail/Makefile b/deskutils/conkyemail/Makefile index 2657107a4202..ffc3d801a980 100644 --- a/deskutils/conkyemail/Makefile +++ b/deskutils/conkyemail/Makefile @@ -3,6 +3,7 @@ PORTNAME= conkyemail PORTVERSION= 2.07 +PORTREVISION= 1 CATEGORIES= deskutils MASTER_SITES= http://launchpadlibrarian.net/28462213/ \ LOCAL/vg @@ -11,18 +12,24 @@ DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= ports@FreeBSD.org COMMENT= Email script for conky +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/COPYING + RUN_DEPENDS= conky:sysutils/conky USES= python:2.7 USE_PYTHON= distutils + NO_BUILD= yes NO_ARCH= yes WRKSRC= ${WRKDIR}/src post-patch: - cd ${WRKSRC} && ${REINPLACE_CMD} -e 's,/usr/share/${PORTNAME},${DATADIR},g' \ + @cd ${WRKSRC} && ${REINPLACE_CMD} -e 's,/usr/share/${PORTNAME},${DATADIR},g; \ + s,%%DATADIR%%,${DATADIR},; \ + s,%%PYTHON_CMD%%,${PYTHON_CMD},' \ conkyEmail conkyEmail.py setup.py example/conkyrc - cd ${WRKSRC} && ${RM} -r example/conkyrc.bak + @cd ${WRKSRC} && ${RM} -r example/conkyrc.bak .include diff --git a/deskutils/conkyemail/files/patch-conkyEmail b/deskutils/conkyemail/files/patch-conkyEmail index 981f89d7f1cd..0771ca05b240 100644 --- a/deskutils/conkyemail/files/patch-conkyEmail +++ b/deskutils/conkyemail/files/patch-conkyEmail @@ -1,7 +1,8 @@ ---- conkyEmail.orig 2008-09-09 06:12:46.000000000 +0800 -+++ conkyEmail 2010-05-08 02:28:45.000000000 +0800 +--- conkyEmail.orig 2008-09-08 22:12:46 UTC ++++ conkyEmail @@ -1,3 +1,3 @@ #! /bin/sh - cd /usr/share/conkyemail/ +-cd /usr/share/conkyemail/ -$PYTHONPATH /usr/bin/python /usr/share/conkyemail/conkyEmail.py "$@" -+$PYTHONPATH /usr/bin/env python /usr/share/conkyemail/conkyEmail.py "$@" ++cd %%DATADIR%% ++%%PYTHON_CMD%% %%DATADIR%%/conkyEmail.py "$@" -- cgit v1.2.3