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

Melvyn Sopacua melvyn at magemana.nl
Thu Jun 19 21:32:26 UTC 2014


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

(untested)

--
Melvyn


More information about the freebsd-ports mailing list