Dealing with FreeBSD Port Options

Sometime when you build a port in FreeBSD, you are confronted with a curses menu like the following. This example shows the menu that appears when you run 'make' as root in the /usr/ports/ftp/gftp directory. If you hit 'OK' and then interrupt the port building process, and run 'make' again, you will not see the menu:

orr:/usr/ports/ftp/gftp# make
...menu appears, hit 'OK'...
===> WARNING: Vulnerability database out of date, checking anyway
===> Found saved configuration for gftp-2.0.18
===> Extracting for gftp-2.0.18
=> Checksum mismatch for gftp-2.0.18.tar.gz.
===> Refetch for 1 more times files: gftp-2.0.18.tar.gz
^C
orr:/usr/ports/ftp/gftp# make
===> WARNING: Vulnerability database out of date, checking anyway
===> Found saved configuration for gftp-2.0.18
===> Extracting for gftp-2.0.18
=> Checksum mismatch for gftp-2.0.18.tar.gz.
===> Refetch for 1 more times files: gftp-2.0.18.tar.gz
===> WARNING: Vulnerability database out of date, checking anyway
===> Found saved configuration for gftp-2.0.18
^C

What is happening? Where is the menu?

It turns out the menu process creates a file called 'options' in the /var/db/ports/PORTNAME directory. For example:

orr:/var/db/ports/gftp$ ls -al
total 6
drwxr-xr-x 2 root wheel 512 Nov 1 15:00 .
drwxr-xr-x 3 root wheel 512 Nov 1 14:44 ..
-rw-r--r-- 1 root wheel 167 Nov 1 14:59 options
orr:/var/db/ports/gftp$ cat options
# This file is auto-generated by 'make config'.
# No user-servicable parts inside!
# Options for gftp-2.0.18
_OPTIONS_READ=gftp-2.0.18
WITH_X11=true
WITHOUT_GTK2=true

If you want to eliminate the menu on a subsequent run of 'make', just delete the options file.

Comments

Anonymous said…
you can also do 'make config' and it will re-run the config dialog.
Anonymous said…
Also worth mentioning are the showconfig and rmconfig targets.
Anonymous said…
Every port with options also has a default set. You can supress the interactive dialog (and hence build with the defaults) with BATCH=1 on the make command line.

I add "-M BATCH=1" to PORTUPGRADE_ARGS in /usr/local/etc/pkgtools.conf so that my automated builds aren't stopping to prompt me for options.
Anonymous said…
Thank You!!

Popular posts from this blog

Zeek in Action Videos

MITRE ATT&CK Tactics Are Not Tactics

New Book! The Best of TaoSecurity Blog, Volume 4