mail/fetchmailconf: fix use by simplifing the search for Tkinter etc

When the fetchmailconf port was split off from fetchmail, it inherited
some python version detection logic that had been intended to let
fetchmail be installed with or without python and work either way.
However, this logic 1) no longer works with current python packaging,
and 2) doesn't really make sense in the context of a 'fetchmailconf'
port that already depends on python.

This patch simplifies out that logic.

PR:		239248
Submitted by:	Corey Halpin <chalpin@cs.wisc.edu> (maintainer)
Reported by:	gerard_seibert@outlook.com
This commit is contained in:
Kurt Jaeger 2019-08-04 12:44:57 +00:00
parent f7232bb923
commit ff26be652d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=508092
3 changed files with 4 additions and 21 deletions

View File

@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= fetchmailconf
PORTREVISION= 0
PORTREVISION= 1
DISTNAME= fetchmail-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
MAINTAINER= chalpin@cs.wisc.edu
@ -17,8 +17,8 @@ USES= python:2.7 shebangfix tar:xz
FILESDIR= ${.CURDIR}/files
SHEBANG_FILES= fetchmailconf.py
SUB_FILES= fetchmailconf
SUB_LIST= PYTHON_CMD=${PYTHON_CMD} PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR}
PLIST= ${.CURDIR}/pkg-plist
NO_ARCH= yes
@ -29,7 +29,6 @@ INSTALL_TARGET= install-data-am install-nodist_binSCRIPTS install-man
post-install:
${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/fetchmailconf.py ${STAGEDIR}${PREFIX}/libexec
${RM} ${STAGEDIR}${PREFIX}/man/man1/fetchmail.1*
MASTERDIR= ${.CURDIR}/../fetchmail

View File

@ -1,22 +1,7 @@
#!/bin/sh
#
# Wrapper for the real fetchmailconf. Checks whether Python and Tkinter are
# installed, and runs the real fetchmailconf or alerts the user, as appropriate.
# Wrapper for the real fetchmailconf.
#
# $FreeBSD$
LOCALBASE=%%LOCALBASE%%
if [ -x $LOCALBASE/bin/python ] ; then
PYTHON_VERSION=python$(${LOCALBASE}/bin/python -c 'import sys; print sys.version[:3]' 2>/dev/null)
if [ -e ${LOCALBASE}/lib/${PYTHON_VERSION}/lib-dynload/_tkinter.so ]; then
exec ${LOCALBASE}/libexec/fetchmailconf.py "$@"
fi
fi
cat <<EOF
The fetchmailconf program requires Python with Tkinter, which does
not appear to be installed on this system. Python can be found in
the FreeBSD Ports Collection in lang/python, and Tkinter for Python
can be found in x11-toolkits/py-tkinter.
EOF
exit 1
exec %%PYTHON_CMD%% %%PYTHON_SITELIBDIR%%/fetchmailconf.py "$@"

View File

@ -1,5 +1,4 @@
bin/fetchmailconf
libexec/fetchmailconf.py
man/man1/fetchmailconf.1.gz
%%PYTHON_SITELIBDIR%%/fetchmailconf.py
%%PYTHON_SITELIBDIR%%/fetchmailconf.pyc