8.4. `pkg-req`
Prev | Chapter 8. The `pkg-`*`` Files | Next

## 8.4. `pkg-req`

If your port needs to determine if it should install or not, you can create a `pkg-req` “requirements” script. It will be invoked automatically at installation/de-installation time to determine whether or not installation/de-installation should proceed.

The script will be run at installation time by pkg_add(1) as `pkg-req ${PKGNAME} INSTALL`. At de-installation time it will be run by pkg_delete(1) as `pkg-req ${PKGNAME} DEINSTALL`.

Prev | Up | Next
8.3. `pkg-deinstall` | Home | 8.5. Changing the Names of `pkg-`*`` Files

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.