The first step in building a package is to locate the directory within the pkgsrc tree that contains that package, and then entering that directory. There is a provided search utility called pkglocate which can be used to do a keyword search. However, in practice pkglocate is not a very effective search tool.
A much better search tool can be found at
pkgtools/pkgfind. To install it:
cd /usr/pkgsrc/pkgtools/pkgfind bmake install clean clean-depends
pkgfind <searchterm> should return a much better list of search
It is good practice to always run the
clean-dependstargets after running
bmake install, to avoid leaving old work directories all over the tree As demonstrated by our installation of
pkgfind, the general procedure to build a package using pkgsrc is to:
- Locate the directory containing the package we wish to install.
cdinto that directory
bmake installin that directory.
bmakeas opposed to just
makebecause pkgsrc uses the NetBSD version of the make utility, which supports somewhat different
Makefilesyntax than GNU make.