Subject: Consistency in mk/defaults/mk.conf
To: None <tech-pkg@netbsd.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 11/15/2005 03:45:34
This is a multi-part message in MIME format.
--------------090009060908030205080308
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

the file mk/defaults/mk.conf contains default values for variables that 
are intended to be set in the MAKECONF file (usually /etc/mk.conf). 
Currently there are two different approaches to set default values:

1. Provide only comments:
#ACROREAD_FONTPATH?=    ${PREFIX}/lib/X11/fonts/TTF
# Colon separated list of additional directories for acroread7 to
# look in for TTF/Type1 fonts.
# Default: ${PREFIX}/lib/X11/fonts/TTF

2. Actually provide a default value:
PKGSRC_COMPILER?=       gcc
# Compiler type(s) to use for building packages
# Possible: (see comments in mk/compiler.mk)
# Default: "gcc"

The difference between the two is that the first one needs a proper 
definition in a package Makefile.

I have recently implemented a pkglint check that considers every 
variable in mk/defaults/mk.conf to be user-settable, that is, packages 
must not set or modify that variable. The check is currently disabled, 
but it shows some bugs in packages that should be fixed, so I think it 
is useful. A possible pkglint output is:

$ pkglint print/acroread7
ERROR: print/acroread7/Makefile:54: "ACROREAD_FONTPATH" may only
     be set by the user, not the package.

This error message would not appear if ACROREAD_FONTPATH had its default 
value set in mk/defaults/mk.conf. Therefore I prefer the second approach 
from above for defining default values whenever that is possible.

I have appended the list of errors pkglint spits out because of that 
change. Does anyone see any objections against changing type 1 
definitions to type 2 definitions where that makes sense? Which ones 
need further discussion?

Roland

--------------090009060908030205080308
Content-Type: text/plain;
 name="read-only-vars.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="read-only-vars.txt"

ERROR: cad/fastcap/Makefile:14: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: cad/felt/Makefile:18: "XAW_TYPE" may only be set by the user, not the package.
ERROR: cad/wcalc/Makefile.common:23: "WCALC_HTMLDIR" may only be set by the user, not the package.
ERROR: cad/wcalc/Makefile.common:26: "WCALC_HTMLPATH" may only be set by the user, not the package.
ERROR: cad/wcalc/Makefile.common:29: "WCALC_CGIDIR" may only be set by the user, not the package.
ERROR: cad/wcalc/Makefile.common:32: "WCALC_CGIPATH" may only be set by the user, not the package.
ERROR: chat/jabberd2/Makefile:43: "JABBERD_USER" may only be set by the user, not the package.
ERROR: chat/jabberd2/Makefile:44: "JABBERD_GROUP" may only be set by the user, not the package.
ERROR: chat/mu-conference/Makefile:27: "JABBERD_USER" may only be set by the user, not the package.
ERROR: databases/mysql-client/Makefile.common:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: databases/mysql-client/Makefile.common:23: "MYSQL_USER" may only be set by the user, not the package.
ERROR: databases/mysql-client/Makefile.common:24: "MYSQL_GROUP" may only be set by the user, not the package.
ERROR: databases/mysql-client/Makefile.common:25: "MYSQL_DATADIR" may only be set by the user, not the package.
ERROR: databases/mysql4-client/Makefile.common:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: databases/mysql4-client/Makefile.common:23: "MYSQL_USER" may only be set by the user, not the package.
ERROR: databases/mysql4-client/Makefile.common:24: "MYSQL_GROUP" may only be set by the user, not the package.
ERROR: databases/mysql4-client/Makefile.common:25: "MYSQL_DATADIR" may only be set by the user, not the package.
ERROR: databases/mysql5-client/Makefile.common:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: databases/mysql5-client/Makefile.common:23: "MYSQL_USER" may only be set by the user, not the package.
ERROR: databases/mysql5-client/Makefile.common:24: "MYSQL_GROUP" may only be set by the user, not the package.
ERROR: databases/mysql5-client/Makefile.common:25: "MYSQL_DATADIR" may only be set by the user, not the package.
ERROR: databases/phpmyadmin/Makefile:27: "APACHE_USER" may only be set by the user, not the package.
ERROR: databases/postgresql73-server/Makefile:42: "PGUSER" may only be set by the user, not the package.
ERROR: databases/postgresql73-server/Makefile:43: "PGGROUP" may only be set by the user, not the package.
ERROR: databases/postgresql73-server/Makefile:44: "PGHOME" may only be set by the user, not the package.
ERROR: databases/postgresql74-server/Makefile:42: "PGUSER" may only be set by the user, not the package.
ERROR: databases/postgresql74-server/Makefile:43: "PGGROUP" may only be set by the user, not the package.
ERROR: databases/postgresql74-server/Makefile:44: "PGHOME" may only be set by the user, not the package.
ERROR: databases/postgresql80-server/Makefile:56: "PGUSER" may only be set by the user, not the package.
ERROR: databases/postgresql80-server/Makefile:57: "PGGROUP" may only be set by the user, not the package.
ERROR: databases/postgresql80-server/Makefile:58: "PGHOME" may only be set by the user, not the package.
ERROR: databases/sqlitemanager/Makefile:15: "APACHE_USER" may only be set by the user, not the package.
ERROR: devel/mantis/Makefile:28: "APACHE_USER" may only be set by the user, not the package.
ERROR: devel/p5-Getopt-Simple/Makefile:16: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: editors/emacs20/Makefile:52: "EMACS_USE_POP" may only be set by the user, not the package.
ERROR: editors/nvi-m17n/Makefile:28: "PATCH_FUZZ_FACTOR" may only be set by the user, not the package.
ERROR: editors/vim-xaw/Makefile:25: "XAW_TYPE" may only be set by the user, not the package.
ERROR: editors/xvile/Makefile:33: "XAW_TYPE" may only be set by the user, not the package.
ERROR: emulators/compat12/Makefile:36: "LOCALBASE" may only be set by the user, not the package.
ERROR: emulators/compat13/Makefile:39: "LOCALBASE" may only be set by the user, not the package.
ERROR: emulators/compat14/Makefile:43: "LOCALBASE" may only be set by the user, not the package.
ERROR: emulators/compat14-crypto/Makefile:45: "LOCALBASE" may only be set by the user, not the package.
ERROR: emulators/suse91_expat/Makefile:19: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: emulators/suse91_glx/Makefile:20: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: emulators/suse91_libjpeg/Makefile:19: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: emulators/suse_libjpeg/Makefile:20: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: emulators/vmware-module/Makefile:23: "BSDSRCDIR" may only be set by the user, not the package.
ERROR: games/xfrisk/Makefile:27: "XAW_TYPE" may only be set by the user, not the package.
ERROR: games/xfrisk/Makefile:30: "XAW_TYPE" may only be set by the user, not the package.
ERROR: games/xgalaga/Makefile:16: "SETGIDGAME" may only be set by the user, not the package.
ERROR: games/xgospel/Makefile:14: "XAW_TYPE" may only be set by the user, not the package.
ERROR: games/xscrabble/Makefile:27: "SETGIDGAME" may only be set by the user, not the package.
ERROR: graphics/graphviz/Makefile:18: "XAW_TYPE" may only be set by the user, not the package.
ERROR: graphics/xfig/Makefile:19: "XAW_TYPE" may only be set by the user, not the package.
ERROR: inputmethod/ja-freewnn-server-bin/Makefile:26: "FREEWNN_USER" may only be set by the user, not the package.
ERROR: inputmethod/ja-freewnn-server-bin/Makefile:27: "FREEWNN_GROUP" may only be set by the user, not the package.
ERROR: lang/japhar/Makefile:24: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: lang/kaffe/Makefile.common:15: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: lang/mono/Makefile:27: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: lang/mzscheme/Makefile:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: lang/smalltalk/Makefile:13: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: mail/cyrus-imapd/Makefile:26: "CYRUS_USER" may only be set by the user, not the package.
ERROR: mail/cyrus-imapd/Makefile:27: "CYRUS_GROUP" may only be set by the user, not the package.
ERROR: mail/cyrus-imapd21/Makefile:28: "CYRUS_USER" may only be set by the user, not the package.
ERROR: mail/cyrus-imapd21/Makefile:29: "CYRUS_GROUP" may only be set by the user, not the package.
ERROR: mail/majordomo/Makefile:37: "MAJORDOMO_TMPDIR" may only be set by the user, not the package.
ERROR: mail/majordomo/Makefile:39: "MAJORDOMO_USER" may only be set by the user, not the package.
ERROR: mail/majordomo/Makefile:40: "MAJORDOMO_GROUP" may only be set by the user, not the package.
ERROR: mail/mimedefang/Makefile:28: "DEFANG_SPOOLDIR" may only be set by the user, not the package.
ERROR: mail/mimedefang/Makefile:29: "DEFANG_USER" may only be set by the user, not the package.
ERROR: mail/mimedefang/Makefile:30: "DEFANG_GROUP" may only be set by the user, not the package.
ERROR: mail/nmh/Makefile:26: "NMH_MTA" may only be set by the user, not the package.
ERROR: mail/procmail/Makefile:23--24: "PROCMAIL_TRUSTED_IDS" may only be set by the user, not the package.
ERROR: mail/qpopper/Makefile:25: "QPOPPER_USER" may only be set by the user, not the package.
ERROR: mail/qpopper/Makefile.common:10: "QPOPPER_FAC" may only be set by the user, not the package.
ERROR: mail/ripmime/Makefile:12: "PKGMANDIR" may only be set by the user, not the package.
ERROR: mail/thunderbird/Makefile:8: "MOZILLA_USE_XFT" may only be set by the user, not the package.
ERROR: meta-pkgs/XFree86/Makefile.common:154: "IMAKE" may only be set by the user, not the package.
ERROR: meta-pkgs/xorg/Makefile.common:201: "IMAKE" may only be set by the user, not the package.
ERROR: misc/dt/Makefile:36: "DT_LAYOUT" may only be set by the user, not the package.
ERROR: misc/jitterbug/Makefile:31: "JB_PACKAGE" may only be set by the user, not the package.
ERROR: misc/jitterbug/Makefile:33: "JB_USER" may only be set by the user, not the package.
ERROR: misc/jitterbug/Makefile:34: "JB_USERID" may only be set by the user, not the package.
ERROR: misc/jitterbug/Makefile:36: "JB_GROUP" may only be set by the user, not the package.
ERROR: misc/jitterbug/Makefile:37: "JB_GROUPID" may only be set by the user, not the package.
ERROR: misc/koffice/Makefile:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: net/freeradius/Makefile:19: "LIBTOOLIZE_PLIST" may only be set by the user, not the package.
ERROR: net/sdist/Makefile:18: "SDIST_PAWD" may only be set by the user, not the package.
ERROR: net/ssync/Makefile:18: "SSYNC_PAWD" may only be set by the user, not the package.
ERROR: net/userppp/Makefile:32: "USERPPP_GROUP" may only be set by the user, not the package.
ERROR: news/inn/Makefile.common:5: "INN_DATA_DIR" may only be set by the user, not the package.
ERROR: news/tin/Makefile:29: "INN_DATA_DIR" may only be set by the user, not the package.
ERROR: parallel/pvm3/Makefile:14: "PVM_SSH" may only be set by the user, not the package.
ERROR: parallel/pvm3/Makefile:17: "PVM_SSH" may only be set by the user, not the package.
ERROR: pkgtools/pkgdiff/Makefile:32: "MANINSTALL" may only be set by the user, not the package.
ERROR: pkgtools/shlock/Makefile:26: "PKGSRC_LOCKTYPE" may only be set by the user, not the package.
ERROR: pkgtools/shlock/Makefile:30: "MANINSTALL" may only be set by the user, not the package.
ERROR: print/acroread7/Makefile:54: "ACROREAD_FONTPATH" may only be set by the user, not the package.
ERROR: print/cups/Makefile:75: "CUPS_USER" may only be set by the user, not the package.
ERROR: print/cups/Makefile:76: "CUPS_GROUP" may only be set by the user, not the package.
ERROR: print/magicfilter/Makefile:29: "PAPERSIZE" may only be set by the user, not the package.
ERROR: print/psutils/Makefile:21: "PAPERSIZE" may only be set by the user, not the package.
ERROR: security/PAM/module.mk:9: "DEFAULT_VIEW.${PKGBASE}" may only be set by the user, not the package.
ERROR: security/cyrus-sasl2/Makefile:57: "CYRUS_USER" may only be set by the user, not the package.
ERROR: security/cyrus-sasl2/Makefile:58: "CYRUS_GROUP" may only be set by the user, not the package.
ERROR: security/cyrus-sasl2/Makefile.common:39: "DEFAULT_VIEW.${PKGBASE}" may only be set by the user, not the package.
ERROR: security/tripwire/Makefile:33: "PRE_ROOT_CMD" may only be set by the user, not the package.
ERROR: sysutils/amanda-common/Makefile.common:21: "AMANDA_USER" may only be set by the user, not the package.
ERROR: sysutils/amanda-common/Makefile.common:22: "AMANDA_TMP" may only be set by the user, not the package.
ERROR: sysutils/amanda-common/Makefile.common:23: "AMANDA_VAR" may only be set by the user, not the package.
ERROR: sysutils/fdgw/Makefile:57: "BSDSRCDIR" may only be set by the user, not the package.
ERROR: sysutils/lsof/Makefile:42: "LSOF_MORE_SECURE" may only be set by the user, not the package.
ERROR: wm/windowmaker/Makefile:55: "WINDOWMAKER_OPTIONS" may only be set by the user, not the package.
ERROR: www/ap-jserv/Makefile:30: "JSDK_HOME" may only be set by the user, not the package.
ERROR: www/apache/Makefile:59: "APACHE_USER" may only be set by the user, not the package.
ERROR: www/apache/Makefile:60: "APACHE_GROUP" may only be set by the user, not the package.
ERROR: www/apache/Makefile:72: "APACHE_SUEXEC_DOCROOT" may only be set by the user, not the package.
ERROR: www/apache2/Makefile:68: "APACHE_USER" may only be set by the user, not the package.
ERROR: www/apache2/Makefile:69: "APACHE_GROUP" may only be set by the user, not the package.
ERROR: www/apache2/options.mk:9: "APACHE_SUEXEC_DOCROOT" may only be set by the user, not the package.
ERROR: www/awstats/Makefile:21: "APACHE_USER" may only be set by the user, not the package.
ERROR: www/awstats/Makefile:22: "APACHE_GROUP" may only be set by the user, not the package.
ERROR: www/firefox/Makefile:8: "MOZILLA_USE_XFT" may only be set by the user, not the package.
ERROR: www/galeon/Makefile:25: "MOZILLA_USE_XFT" may only be set by the user, not the package.
ERROR: www/mozilla-gtk2/Makefile:23: "MOZILLA_USE_XFT" may only be set by the user, not the package.
ERROR: www/netscape7/Makefile:29: "PKG_LANG" may only be set by the user, not the package.
ERROR: www/p5-HTML-LinkExtractor/Makefile:14: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: www/p5-HTML-Scrubber/Makefile:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: www/ruby-tag/Makefile:17: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: www/thttpd/Makefile:27: "THTTPD_LOG_FACILITY" may only be set by the user, not the package.
ERROR: www/zope3/Makefile:24: "EXTRACT_USING" may only be set by the user, not the package.
ERROR: x11/dtx11session/Makefile:17: "LOCALBASE" may only be set by the user, not the package.
ERROR: x11/gnome-themes-extras/Makefile:17: "EXTRACT_USING" may only be set by the user, not the package.

--------------090009060908030205080308--