• Re: OPTIONS or IGNORE based on OSVERSION?

    From =?UTF-8?B?VMSzbA==?= Coosemans@tijl@FreeBSD.org to muc.lists.freebsd.ports on Tue Jan 13 14:28:58 2026
    From Newsgroup: muc.lists.freebsd.ports

    On Mon, 12 Jan 2026 19:44:41 +0000 Christian Ullrich wrote:
    Hello,

    I'm trying to give www/mod_auth_gssapi support for MIT Kerberos in base
    on FreeBSD 15+. That part is actually easy, but what I cannot figure out
    is how to treat earlier versions.

    What I would like to do is either not offer the option at all or, if
    that is not possible, IGNORE if the GSSAPI_BASE option is set and the
    system does not have MIT Kerberos in base (OSVERSION < 1500054).

    I tried wrapping the entire OPTIONS block in

    .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500054

    , but that needs <bsd.port.options.mk> for OSVERSION, and that in turn
    must come _after_ the OPTIONS block. Using <bsd.port.pre.mk> instead
    does not work either; it breaks make config (or in my case, poudriere options), the options just aren't set anymore.

    I also tried

    .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500054
    GSSAPI_BASE_IGNORE= Needs MIT Kerberos in base
    .endif

    , and that has the same problem: If it is after <bsd.port.options.mk> it does not work, and if it is before, I don't have OPSYS and/or OSVERSION.

    Is there a way to do this, or perhaps a much better solution I have not thought of, and should I even spend more time working on it with 14.3
    going out of support in five months?

    Thanks for any help.

    To exclude entire major versions you can use:

    OPTIONS_EXCLUDE_FreeBSD_13= GSSAPI_BASE
    OPTIONS_EXCLUDE_FreeBSD_14= GSSAPI_BASE

    For more complicated cases you can set IGNORE like this:

    .include <bsd.port.options.mk>

    .if ${PORT_OPTIONS:MGSSAPI_BASE} && ${OPSYS} == FreeBSD && ${OSVERSION} < 1500054
    IGNORE= Needs MIT Kerberos in base
    .endif


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2