How can I override global OPTIONS_UNSET for specific port in make.conf? www/xcache

Miroslav Lachman 000.fbsd at quip.cz
Thu Jun 19 21:56:03 UTC 2014


Melvyn Sopacua wrote:
> Hi,
>
> On Thu, 19 Jun 2014, Miroslav Lachman wrote:
>
>> I don't need DOCS, EXAMPLES etc. for each port as I normaly do not use
>> them on servers.
>> I have this line in make.conf
>>
>> OPTIONS_UNSET= X11 GUI CUPS DOCS EXAMPLES NLS
>
>> So how can I have globally disabled EXAMPLES and enable it only for
>> one specific port?
>
> I don't know if there's a simpler way, but this will work:
>
> OPTIONS_UNSET= X11 GUI CUPS DOCS NLS
> .if empty(.CURDIR:M*/www/xcache)
> OPTIONS_UNSET+= EXAMPLES
> .endif
>
> Of course, this gets more complex the more exceptions you want,
> ultimately arriving at something like this
>
> PORTS_WITH_EXAMPLES= www/xcache misc/foo
> _WANT_EXAMPLES=0
> OPTIONS_UNSET= X11 GUI CUPS DOCS NLS
> .for port in ${PORTS_WITH_EXAMPLES}
> .if !empty(.CURDIR:M*${port}) # not sure about this var expansion
> _WANT_EXAMPLES=1
> .endif
> .if ${_WANT_EXAMPLES} == 0
> OPTIONS_UNSET+= EXAMPLES
> .endif

I consider it as a workaround. There should be some better way instead 
of manipulating with global OPTIONS_SET or OPTIONS_UNSET.

Thank you for your suggestions!

Miroslav Lachman


More information about the freebsd-ports mailing list