1# rules to install manpages
2# Copyright 2008 Roy Marples <roy@marples.name>
3
4_MANPREFIX_SH=	if [ -n "${PREFIX}" ]; then echo "${PREFIX}"; else echo "/usr/share"; fi
5_MANPREFIX!=	${_MANPREFIX_SH}
6MANPREFIX?=	${_MANPREFIX}$(shell ${_MANPREFIX_SH})
7
8MANDIR?=	${MANPREFIX}/man/man
9MANMODE?=	0444
10
11_MAN5_SH=	for man in ${MAN}; do case $$man in *.5) echo $$man;; esac; done
12_MAN5!=		${_MAN5_SH}
13MAN5=		${_MAN5}$(shell ${_MAN5_SH})
14
15_MAN8_SH=	for man in ${MAN}; do case $$man in *.8) echo $$man;; esac; done
16_MAN8!=		${_MAN8_SH}
17MAN8=		${_MAN8}$(shell ${_MAN8_SH})
18
19_man: ${MAN}
20
21_maninstall: _man
22	${INSTALL} -d ${DESTDIR}${MANDIR}5
23	${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}5
24	${INSTALL} -d ${DESTDIR}${MANDIR}8
25	${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}8
26