Way to make settings in /etc/make.conf effective only for ports

Dewayne Geraghty dewayne.geraghty at heuristicsystems.com.au
Sun Jun 22 13:03:07 UTC 2014


On 22/06/2014 7:40 PM, Alfred Perlstein wrote:
>
> On 6/22/14, 2:20 AM, Melvyn Sopacua wrote:
>> Hi Yasuhiro,
>>
>> On Sun, 22 Jun 2014, Yasuhiro KIMURA wrote:
>>
>>> Recently I found some of settings for ports in /etc/make.conf
>>> interfere with other software project. So are there any way to make
>>> settings in /etc/make.conf effective only for ports?
>>
>> You can wrap those settings in .CURDIR check:
>> .if !empty(.CURDIR:M/usr/ports/*)
>> # port settings here
>> .endif
>
> What about using a check for ../../Mk/bsd.ports.mk or
> ../Mk/bsd.ports.mk ?
>>
>> Alternatively, you can make a different file, say /etc/make.ports.conf
>> and then build ports with the environment variable __MAKE_CONF set to
>> it.
>> -- 
>> Melvyn
>> _______________________________________________
>> freebsd-ports at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
>> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
>>
>
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
>
>
Simplest way would be to install ports-mgmt/portconf. The installation
appends what's needed to /etc/make.conf
Then you need to add to /usr/local/etc/ports.conf to enable what you
require the port to do.  Something like:

databases/mariadb55-client: mariadb_UNSET=MAXKEY X11 GNOMEVFS
lang/perl*: OPTIONS_SET=THREADS PERL_64BITINT
lang/php5:  php5_UNSET=DEBUG MULTIBYTE X11 GNOMEVFS | php5_SET=APACHE
SUHOSIN

should give you a sense of what you can do.  The above is an extract
from a script that was used during the transition from WITH_|WITHOUT_ to
OPTIONS_SET|OPTIONS_UNSET and ${UNIQUENAME}_SET${UNIQUENAME}_UNSET, but
it should serve to give you a clue as to how to make tweaking your ports
a lot easier.  Then when you want to make a port just
make -DBATCH
this avoids the dialogue and provides consistency when building a lot of
ports across different machines &/or platforms.  It also saves
cluttering your make.conf.

Regards, Dewayne.


More information about the freebsd-ports mailing list