NetBSD pkgsrc (Source Code Installs)

Install programs onto NetBSD building from source code.

Install NetBSD ports

Download and install the pkgsrc contents:

ftp ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
tar -zxf pkgsrc.tar.gz -C /usr

Build package vulnerability database:

/usr/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities
PATH="/usr/pkg/sbin:$PATH"
export PATH
Build the search database

This will take a long time.

cd /usr/pkgsrc
make search
Build a static list
find /usr/pkgsrc/ -type d -mindepth 2 -maxdepth 2 | grep -v CVS | cut -d "/" -f 4- > pkgsrc

Package Source Management

Display build options
make show-options
Uninstall a package
make deinstall
Edit package build options

Add to /etc/mk.conf:

PKG_OPTIONS.apache22 = apache-mpm-worker -apache-mpm-prefork suexec
Allow vulnerable licenses

Add to /etc/mk.conf:

ACCEPTABLE_LICENSES+= vim-license
Allow vulnerable packages
echo ALLOW_VULNERABLE_PACKAGES=1 >> /etc/mk.conf

Building Packages

Run make clean on all dependencies
make clean-depends