make this work whether or not MANZ is defined. also, clean it up a bit,

remove some extra cruft, and make the way compressed man pages are installed
a bit more sane.  (DON'T blow away uncompressed man pages of the same name,
if they're also there...)
This commit is contained in:
cgd 1995-06-07 01:15:20 +00:00
parent 2994e22402
commit 741ffd7de0
1 changed files with 20 additions and 17 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.man.mk,v 1.19 1995/06/02 02:52:07 brezak Exp $
# $NetBSD: bsd.man.mk,v 1.20 1995/06/07 01:15:20 cgd Exp $
# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
MANTARGET?= cat
@ -23,24 +23,28 @@ MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.4$/.cat4/g:S/.5$/.cat
.endif
MINSTALL= install ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
MCOMPRESS= gzip -f
.if defined(MANZ)
# chown and chmod are done afterward automatically
MCOMPRESS= gzip -cf
MCOMPRESSSUFFIX= .gz
.endif
maninstall:
.if defined(MANALL)
@for page in ${MANALL}; do \
dir=${DESTDIR}${MANDIR}`expr $$page : '.*\.cat\([1-8]\)'`; \
instpage=$${dir}${MANSUBDIR}/`expr $$page : '\(.*\)\.cat[1-8]'`.0; \
echo ${MINSTALL} $$page $$instpage; \
${MINSTALL} $$page $$instpage; \
instpage=$${dir}${MANSUBDIR}/`expr $$page : '\(.*\)\.cat[1-8]'`.0${MCOMPRESSSUFFIX}; \
if [ X"${MCOMPRESS}" = X ]; then \
echo ${MINSTALL} $$page $$instpage; \
${MINSTALL} $$page $$instpage; \
else \
rm -f $$instpage; \
echo ${MCOMPRESS} $$page \> $$instpage; \
${MCOMPRESS} $$page > $$instpage; \
chown ${MANOWN}:${MANGRP} $$instpage; \
chmod ${MANMODE} $$instpage; \
fi \
done
.if defined(MANZ)
@for page in ${MANALL}; do \
dir=${DESTDIR}${MANDIR}`expr $$page : '.*\.cat\([1-8]\)'`; \
instpage=$${dir}${MANSUBDIR}/`expr $$page : '\(.*\)\.cat[1-8]'`.0; \
echo "compressing $$instpage"; \
${MCOMPRESS} $$instpage; \
done
.endif
.endif
.if defined(MLINKS) && !empty(MLINKS)
@set ${MLINKS}; \
@ -48,16 +52,15 @@ maninstall:
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
l=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0*; \
z=`expr $$l : '.*0\.\(.*\)'`; \
l=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0${MCOMPRESSSUFFIX}; \
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0$${z:+.}$${z}; \
t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0${MCOMPRESSSUFFIX}; \
echo $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
done; true
done
.endif
.if defined(MANALL)