Building Source Packages
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
Now running pkgfind <searchterm> should return a much better list of search
results.
NOTE:
It is good practice to always run the
cleanandclean-dependstargets after runningbmake install, to avoid leaving old work directories all over the tree As demonstrated by our installation ofpkgfind, the general procedure to build a package using pkgsrc is to:
- Locate the directory containing the package we wish to install.
cdinto that directory- Run
bmake installin that directory.
NOTE:
We run
bmakeas opposed to justmakebecause pkgsrc uses the NetBSD version of the make utility, which supports somewhat differentMakefilesyntax than GNU make.