summaryrefslogtreecommitdiff
path: root/mk/install/install-info
blob: bb3dc2e1c03f869f344b4e8c27acf662a4d7bc3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# $NetBSD
#
# Handle registration of Info files; used by texinfo.mk.
#

INFO_FILES="@INFO_FILES@"
INSTALL_INFO="@INSTALL_INFO@"
INFO_DIR="@INFO_DIR@"

case ${STAGE} in
VIEW-INSTALL)
	if [ -f ${PKG_PREFIX}/${INFO_DIR}/dir ]; then
		_nentries="`${GREP} -c '^\*' ${PKG_PREFIX}/${INFO_DIR}/dir 2>/dev/null`"
		if [ x"${_nentries}" != x -a "${_nentries}" -lt 1 ]; then
			${RM} ${PKG_PREFIX}/${INFO_DIR}/dir
		fi

	fi
	for f in ${INFO_FILES}; do
		${INSTALL_INFO} --delete --info-dir=${PKG_PREFIX}/${INFO_DIR} \
		   ${PKG_PREFIX}/${INFO_DIR}/${f} 1>/dev/null 2>&1
		${INSTALL_INFO} --info-dir=${PKG_PREFIX}/${INFO_DIR} \
		   ${PKG_PREFIX}/${INFO_DIR}/${f}
	done
	;;
VIEW-DEINSTALL)
	for f in ${INFO_FILES}; do
		${INSTALL_INFO} --delete --info-dir=${PKG_PREFIX}/${INFO_DIR} \
		   ${PKG_PREFIX}/${INFO_DIR}/${f} 1>/dev/null 2>&1
	done
	_nentries="`${GREP} -c '^\*' ${PKG_PREFIX}/${INFO_DIR}/dir 2>/dev/null`"
	if [ x"${_nentries}" != x -a "${_nentries}" -le 1 ]; then
		${RM} ${PKG_PREFIX}/${INFO_DIR}/dir
	fi
	;;
esac