I think the following is a much better approach at handling the "fetchmailconf" script: Properly depend on python (and -tkinter) at runtime and replace the shebang line in the script.
Index: Makefile =================================================================== RCS file: /cvs/ports/mail/fetchmail/Makefile,v retrieving revision 1.126 diff -u -p -r1.126 Makefile --- Makefile 6 Jun 2011 13:57:07 -0000 1.126 +++ Makefile 23 Aug 2011 16:34:58 -0000 @@ -3,20 +3,24 @@ COMMENT= mail retrieval utility for POP2, POP3, KPOP, IMAP and more DISTNAME= fetchmail-6.3.20 +REVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_BERLIOS:=fetchmail/} HOMEPAGE= http://fetchmail.berlios.de/ -# GPLv2(+) +# GPLv2+ PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes WANTLIB= c crypto krb5 ssl -MODULES= devel/gettext +MODULES= devel/gettext \ + lang/python +MODPY_BUILDDEP= No BUILD_DEPENDS= devel/bison +RUN_DEPENDS+= lang/python/${MODPY_VERSION},-tkinter SEPARATE_BUILD= concurrent CONFIGURE_STYLE= gnu @@ -37,8 +41,6 @@ post-extract: @rm -f ${WRKSRC}/rcfile_y.[ch] pre-patch: - @sed -e "s|@PREFIX@|${LOCALBASE}|" \ - ${FILESDIR}/fetchmailconf > ${WRKDIR}/fetchmailconf @tbl ${WRKSRC}/fetchmail.man > ${WRKSRC}/fetchmail.tbl && \ cp -f ${WRKSRC}/fetchmail.tbl ${WRKSRC}/fetchmail.man @@ -46,8 +48,8 @@ post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/fetchmail @cd ${PREFIX}/man/man1 && ln -sf fetchmail.1 fetchmailconf.1 cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/fetchmail + ${MODPY_BIN_ADJ} ${WRKSRC}/fetchmailconf.py ${INSTALL_SCRIPT} ${WRKSRC}/fetchmailconf.py \ - ${PREFIX}/libexec/fetchmailconf.bin - ${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${PREFIX}/bin + ${PREFIX}/bin/fetchmailconf .include <bsd.port.mk> Index: files/fetchmailconf =================================================================== RCS file: files/fetchmailconf diff -N files/fetchmailconf --- files/fetchmailconf 23 Jul 2000 22:42:53 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Wrapper for the real fetchmailconf. Checks whether Python is installed, -# and runs the real fetchmailconf or alerts the user, as appropriate. -# - -PREFIX=@PREFIX@ - -if [ -x $PREFIX/bin/python ]; then - exec $PREFIX/libexec/fetchmailconf.bin -else - cat <<EOF -The fetchmailconf program requires Python, which does not appear to be -installed on this system. Python can be found in the OpenBSD Ports -Collection under lang/python. -EOF - exit 1 -fi Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/mail/fetchmail/pkg/PLIST,v retrieving revision 1.19 diff -u -p -r1.19 PLIST --- pkg/PLIST 11 Oct 2009 20:52:17 -0000 1.19 +++ pkg/PLIST 23 Aug 2011 16:34:58 -0000 @@ -1,7 +1,6 @@ @comment $OpenBSD: PLIST,v 1.19 2009/10/11 20:52:17 sthen Exp $ @bin bin/fetchmail bin/fetchmailconf -libexec/fetchmailconf.bin @man man/man1/fetchmail.1 @man man/man1/fetchmailconf.1 share/doc/fetchmail/