The pkgsrc guideが参考になります。
パッケージの取得
> cd /usr
> export CVS_RSH=ssh
> cvs -q -z3 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc
パッケージの更新
> export CVS_RSH=ssh
> cd /usr/pkgsrc
> cvs update -Pd
パッケージのインストール
> cd /usr/pkgsrc/shells/bash
> make
> make install
インストール一時ファイルの消去
> make clean
> make clean-depends
パッケージのコンパイル・オプションの確認
> cd /usr/pkgsrc/print/ghostscript
> make show-options
Any of the following general options may be selected:
cups Enable cups (Common UNIX Printing System) support.
debug Enable debugging facilities in the package.
fontconfig
x11 Enable X11 support.
These options are enabled by default:
fontconfig x11
These options are currently enabled:
You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or PKG_OPTIONS.ghostscript.
パッケージのコンパイル・オプションの設定
/etc/mk.confを編集します。例)x11とfontconfigを無効、debugを有効
PKG_OPTIONS.ghostscript+= -x11 -fontconfig debug
パッケージをソースからインストールするのではなく、バイナリを使用する場合はバイナリ(コンパイル)のパッケージがある場所を指定して行います。小さいシステム上では、パッケージをソースからインストールするなんてありえないので、そんな時にはバイナリのパッケージを使用します。
> PKG_PATH="ftp://ftp2.jp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.1/All"
> export PKG_PATH
> pkg_add bash-2.*