On 2011-08-23, Pascal Stumpf <pascal.stu...@cubes.de> wrote:
> 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.
>

There's no need for forcing that dependency chain on the average box
that runs fetchmail. I would go for one of two options:- either put the
config program into a separate package and just put the deps there, 
or fix up what's there (notes on this method below).

Personally I am a lot happier with the latter, I think subpackaging
this would be overkill.

> +REVISION=    1

0

> -# GPLv2(+)
> +# GPLv2+

ok

> +MODULES=             devel/gettext \
> +                     lang/python
> +MODPY_BUILDDEP=              No

ok but please do MODPY_RUNDEP=No

> +RUN_DEPENDS+=                lang/python/${MODPY_VERSION},-tkinter

see above

> -     @sed -e "s|@PREFIX@|${LOCALBASE}|" \
> -             ${FILESDIR}/fetchmailconf > ${WRKDIR}/fetchmailconf

${SUBST_CMD} -c ${FILESDIR}/fetchmailconf ${WRKDIR}/fetchmailconf

> +     ${MODPY_BIN_ADJ} ${WRKSRC}/fetchmailconf.py

ok

>       ${INSTALL_SCRIPT} ${WRKSRC}/fetchmailconf.py \
> -             ${PREFIX}/libexec/fetchmailconf.bin
> -     ${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${PREFIX}/bin
> +             ${PREFIX}/bin/fetchmailconf

leave this as-is

> +++ /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

if [ -x ${MODPY_BIN} ]; 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.

Refer to packages rather than ports here e.g. something like "Install
the python and python-tkinter packages".


Reply via email to