Setting up /etc/mk.conf for NetBSD and pkgsrc

For my NetBSD builds, I usually set
MKCRYPTO_IDEA=  yes
MKCRYPTO_MDC2=  yes
MKCRYPTO_RC5=   yes
MKDEBUGLIB=     yes
in /etc/mk.conf. The first three build several cryptography libraries which can only be a good thing (I don't think I've ever actually needed one of those).

The effect of MKDEBUGLIB is to create a library with source file and line number information for each system library whose name has _g appended to it. With these libraries I hope to be able to do source-level debugging inside the system libraries which is pretty sweet if you happen to run GNOME and regularly get random crashes inside libpthread, for example.

The remainder of my /etc/mk.conf file is dedicated to pkgsrc:

.ifdef BSD_PKG_MK
# For package development, setting WRKOBJDIR is inconvenient
#WRKOBJDIR=     /usr/obj/pkgsrc
PKG_DEVELOPER=  yes

UPDATE_TARGET=  bin-install
BINPKG_SITES=   # prevent bin-install from accessing ftp
USE_DESTDIR=    yes
MAKE_JOBS=      8
SKIP_LICENSE_CHECK=yes

PKG_DEFAULT_OPTIONS+=   gnome
# Make Firefox look like Firefox
PKG_OPTIONS.firefox+=   official-mozilla-branding

ALLOW_VULNERABLE_PACKAGES=yes # x11/vte

.if exists(/usr/pkg/bin/sudo)
SU_CMD=                 /usr/pkg/bin/sudo /bin/sh -c
.endif
.endif
The interesting value for SU_CMD is needed because pkgsrc passes a shell script to be executed as a single argument, while sudo only supports running a single command with some arguments.

I always use make update to install packages even if they aren't installed yet because this automatically builds, installs and cleans packages and the target it runs is configurable by setting UPDATE_TARGET so if I ever change my mind I can simply change the variable instead of my habit of typing make update.

Comments

Post a Comment