Handy pkgsrc targets and tools

From Wikistix

Bunch of notes on pkgsrc make targets to help my memory when building/modifying pkgsrc packages.

Making and committing changes

Lint packages before committing, using the package pkgtools/pkglint, cleaning up any errors and warnings it reports. Build the package with the make variable PKG_DEVELOPER=yes, cleaning up any additional warnings and errors.

Changes to packages can either be submitted as cvs diff's (with -N if necessary) attached to send-pr, or, get an account for pkgsrc-wip at http://pkgsrc.org/wip/ and commit the new package version there. If committing to pkgsrc-wip, create a top level package file named eg. COMMIT_MESSAGE with the message that should be used to commit to pkgsrc proper.

Make targets

Installing
Target Description
show-options Dump available, default and currently selected package options.
fetch Fetch the distfiles into the local ${DISTDIR} directory.
checksum Check the fetched files checksums against distinfo.
install Actually install for real.
Creating/Modifying Packages
Target Description
extract Stop after extracting the package distfiles.
patch Stop after applying package patches.
makesum Update the checksums of the packages distfiles in distfiles.
makepatchsum
mps
Updates patch checksums in distfiles.
rebuild Forces the package to be rebuilt.
show-distfiles Dumps out expected distfile names.
stage-install Installs into the ${WRKSRC}/.destdir/. Handy for checking what will become the install paths.
install-clean Allows install stage to be re-attempted.
print-PLIST Dumps out a PLIST to stdout based on the staged installation. Sanity check before using!
plist Builds the staged PLIST files from the package PLIST.
plist-clean Removes staged PLIST files so that the "plist" target may be re-invoked.
check-files Checks the staged PLIST against the "staged-install" built contents.
show-var VARNAME=<x> Dumps out evaluated make variable.
show-vars VARNAMES="<x> <y>" Dumps out multiple evaluated make variables.
show-buildlink3 Show the dependency hierarchy for a package.