For any of the main targets described in the previous section, two auxiliary targets exist with "pre-" and "post-" used as a prefix for the main target's name. These targets are invoked before and after the main target is called, allowing extra configuration or installation steps, for example, which program's configure script or install target omitted. For any of these auxiliary targets, scripts of the same name can be placed in the package's scripts-subdirectory that will be executed at the given time, see scripts/*.
Should one of the main targets do the wrong thing, and should there be no variable to fix this, you can redefine it with the do-* target. (Note that redefining the target itself instead of the do-* target is a bad idea, as the pre-* and post-* targets won't be called anymore, etc.) You will not usually need to do this.
If you did a ``make install'' and you noticed some file was not installed properly, you can repeat the installation with this target, which will ignore the "already installed" flag.
This target does a pkg_delete(1) in the current directory, effectively de-installing the package. The following variables can be used either on the command line or in /etc/mk.conf to tune the behaviour:
Add a "-v" flag to the pkg_delete(1) command.
Remove all packages that require (depend on) the given package. This can be used to remove any packages that may have been pulled in by a given package, e.g. if make deinstall DEINSTALLDEPENDS=1 is done in x11/kde, this is likely to remove whole KDE. Works by adding a "-R" to the pkg_delete command line.
This target causes the current package to be updated to the latest version. The package and all depending packages first get deinstalled, then current versions of the corresponding packages get compiled and installed. This is similar to manually noting which packages are currently installed, then performing a series of ``make deinstall'' and ``make install'' for these packages.
You can use the "update" target to resume package updating in case a previous ``make update'' was interrupted for some reason. However, in this case, make sure you don't call ``make clean'' or otherwise remove the list of dependent packages in ${WRKDIR}. Otherwise you lose the ability to automatically update the current package along with the dependent packages you have installed.
Resuming an interrupted ``make update'' will only work as long as the package tree remains unchanged. If the source code for one of the packages to be updated has been changed, resuming ``make update'' will most certainly fail!
The following variables can be used either on the command line or in /etc/mk.conf to alter the behaviour of ``make update'':
Install target to use for the updated package and the dependent packages. Defaults to install. E.g. ``make update DEPENDS_TARGET=package''
Don't clean up after updating. Useful if you want to leave the work sources of the updated packages around for inspection or other purposes. Be sure you eventually clean up the source tree (see the "clean-update" target below) or you may run into troubles with old source code still lying around on your next ``make'' or make update.
Use "reinstall" instead of ${DEPENDS_TARGET} for every package that gets updated. Be sure you know the implications of using the "reinstall" target when using this variable.
Clean the source tree for all packages that would get updated if ``make update'' was called from the current directory. This target should not be used if the current package (or any of its depending packages) have already been deinstalled (e.g., after calling ``make update'') or you may lose some packages you intended to update. As a rule of thumb: only use this target before the first time you call ``make update'' and only if you have a dirty package tree (e.g., if you used NOCLEAN). The following variables can be used either on the command line or in /etc/mk.conf to alter the behaviour of ``make clean-update'':
After ``make clean'', do not reconstruct the list of directories to update for this package. Only use this if ``make update'' successfully installed all packages you wanted to update. Normally, this is done automatically on ``make update'', but may have been suppressed by the NOCLEAN variable (see above).
This target generates a README.html file, which can be viewed using a browser such as netscape (pkgsrc/www/mozilla) or lynx (pkgsrc/www/lynx). The generated files contain references to any packages which are in the ${PACKAGES} directory on the local host. The generated files can be made to refer to URLs based on FTP_PKG_URL_HOST and FTP_PKG_URL_DIR. (For example, if I wanted to generate README.html files which pointed to binary packages on the local machine, in the directory /usr/packages, set FTP_PKG_URL_HOST=file://localhost and FTP_PKG_URL_DIR=/usr/packages. The ${PACKAGES} directory and its subdirectories will be searched for all the binary packages.)
Use this target to create a file README-all.html which contains a list of all packages currently available in the NetBSD Packages Collection, together with the category they belong to and a short description. This file is compiled from the pkgsrc/*/README.html files, so be sure to run this after a ``make readme''.
This is very much the same as the "readme" target (see above), but is to be used when generating a pkgsrc tree to be written to a CD-ROM. This target also produces README.html files, and can be made to refer to URLs based on CDROM_PKG_URL_HOST and CDROM_PKG_URL_DIR.
This target shows which distfiles and patchfiles are needed to build the package. (DISTFILES and PATCHFILES, but not patches/*)
This target shows nothing if the package is not installed. If a version of this package is installed, but is not the version provided in this version of pkgsrc, then a warning message is displayed. This target can be used to show which of your installed packages are downlevel, and so the old versions can be deleted, and the current ones added.
This target shows the directory in the pkgsrc hierarchy from which the package can be built and installed. This may not be the same directory as the one from which the package was installed. This target is intended to be used by people who may wish to upgrade many packages on a single host, and can be invoked from the top-level pkgsrc Makefile by using the target "show-host-specific-pkgs".
After a package is installed, check all it's binaries and (on ELF platforms) shared libraries if they find the shared libs they need. Run by default if PKG_DEVELOPER is set in /etc/mk.conf.