Contents

Available to PC-BSD® is its own PBI collection, FreeBSD ports, and FreeBSD packages. However, it is also possible to use the NetBSD pkgsrc system to build software. This is not (yet) a pre-configured feature, which means there are some special instructions to follow for this functionality to be enabled. This is not an official feature. This section will describe how to configure and use NetBSD pkgsrc from PC-BSD®.

Although these instructions seem complete and look polished, there may still be ommissions or inaccuracies, so be wary.

The vulnerabilities of some ports (ie Firefox) may prevent them from being built. An example mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script. Adjust /usr/pkg/etc/mk.conf to allow vulnerable programs to be built by adding the following line:

ALLOW_VULNERABLE_PACKAGES=TRUE

Keeping pkgsrc up to date

The process for using tar files is very much the same as when obtaining them originally, except that the old tree must be erased first

# rm -rf /usr/pkgsrc/

# ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz

# tar -xzf pkgsrc.tar.gz -C /usr

Next bootstrap pkgsrc again

# cd /usr/pkgsrc/bootstrap/

# ./bootstrap --pkgdbdir /var/db/pkgsrc

Update the bootstrap-mk-files

# cd /usr/pkgsrc/pkgtools/bootstrap-mk-files/

# /usr/pkgsrc/bootstrap/work/bin/bmake update

And if that does not work (such as on a standard NetBSD install) try:

# /usr/pkgsrc/bootstrap/work/bin/bmake replace

# /usr/pkgsrc/bootstrap/work/bin/bmake update

===> Installing for bootstrap-mk-files-20111205
ERROR: bootstrap-mk-files-20111106 is already installed - perhaps an older version?
ERROR: If so, you may use either of:
ERROR: - "pkg_delete bootstrap-mk-files-20111106" and "/usr/pkgsrc/bootstrap/work/bin/bmake reinstall" to upgrade properly
ERROR:
ERROR: - "/usr/pkgsrc/bootstrap/work/bin/bmake update" to rebuild the package and all of its dependencies
ERROR:
ERROR: - "/usr/pkgsrc/bootstrap/work/bin/bmake replace" to replace only the package without re-linking dependencies,
ERROR: risking various problems.

Using pkgsrc to build

Much like using the FreeBSD ports system, building with the NetBSD pkgsrc system is a rather simple matter of going to the location of the application within the pkgsrc tree, and then using bmake, for example:

% su -m

# unsetenv PKG_PATH

# cd /usr/pkgsrc/www/firefox/

# bmake install clean

However, if there may be options that would modify what is built, how it is installed, or the features enabled. The additional steps for options adjustment is done prior to invoking bmake install clean. Discover whether there are options:

Xterm

# bmake show-options

Any of the following general options may be selected:

official-mozilla-branding Use official Mozilla reg. trademarks and logos.

These options are enabled by default:

These options are currently enabled:

You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or PKG_OPTIONS.firefox.

Adding a NetBSD pkg

% su -m

# bpkg_add firefox

The above probably should simply work, or the NetBSD documentation would not mention renaming the FreeBSD pkg tools. However, for the moment, testing this throws the following type of error: