章 8. pkg-*

內容目錄
8.1. pkg-message
8.2. pkg-install
8.3. pkg-deinstall
8.4. Changing the Names of pkg-*
8.5. Making Use of SUB_FILES and SUB_LIST

There are some tricks we have not mentioned yet about the pkg-* files that come in handy sometimes.

8.1. pkg-message

To display a message when the package is installed, place the message in pkg-message. This capability is often useful to display additional installation steps to be taken after a pkg install or to display licensing information.

When some lines about the build-time knobs or warnings have to be displayed, use ECHO_MSG. pkg-message is only for post-installation steps. Likewise, the distinction between ECHO_MSG is for printing informational text to the screen and ECHO_CMD is for command pipelining:

update-etc-shells:
	@${ECHO_MSG} "updating /etc/shells"
	@${CP} /etc/shells /etc/shells.bak
	@( ${GREP} -v ${PREFIX}/bin/bash /etc/shells.bak; \
		${ECHO_CMD} ${PREFIX}/bin/bash) >/etc/shells
	@${RM} /etc/shells.bak

注意:

Do not add an entry for pkg-message in pkg-plist.

本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/

若有 FreeBSD 方面疑問,請先閱讀 FreeBSD 相關文件,如不能解決的話,再洽詢 <questions@FreeBSD.org>。

關於本文件的問題,請洽詢 <doc@FreeBSD.org>。