Subject: Installation of compressed manual pages
To: None <core@NetBSD.ORG>
From: Alistair G. Crooks <agc@uts.amdahl.com>
List: current-users
Date: 01/11/1995 05:49:25
After Bob Kemp's changes to install compressed man pages, I decided
to try to do the same, only changing bsd.man.mk so that no changes
were necessary to xinstall. The following (context diff) is the result.

As with Bob's version, compressed manual pages are dependent upon
the environment variable COMPRESSMAN being set at man page installation
time. Links to compressed manual pages are also installed correctly.
The uncompressed manual pages, once formatted, are kept around in
the object directory so that 2 consecutive "make install"s work fine.

The improvements over Bob's version are:
1. The gzipped manual pages are installed with the correct ownership
and permissions
2. No changes to xinstall are necessary

So to have gzipped manual pages installed automatically,
1. apply the following patch to (version 1.18 of) /usr/share/mk/bsd.man.mk
2. set COMPRESSMAN in your environment
3. (cd <target-dir> ; make && make install)
4. check your /etc/man.conf is up to date - it should be version 1.4 or later

You can then remove the old (uncompressed) man pages.
e.g. find /usr/share/man -name '*.0' -print|xargs rm

It works fine for me on NetBSD/i386 1.0a (as of 4th January 1995
tar_files). However, I'm not responsible for any data loss you might
have. I'm also aware that some people like to have uncompressed manual
pages around - I'm not one of them.

Cheers,
Alistair
--
Alistair G. Crooks (agc@uts.amdahl.com)			   +44 125 234 6377
Amdahl European HQ, Dogmersfield Park, Hartley Wintney, Hants RG27 8TE, UK.

*** 1.1	1995/01/11 13:16:37
--- bsd.man.mk	1995/01/11 13:07:36
***************
*** 22,34 ****
  
  MINSTALL=	install ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
  
  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; \
  	done
  .endif
  .if defined(MLINKS) && !empty(MLINKS)
--- 22,48 ----
  
  MINSTALL=	install ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
  
+ .if defined(COMPRESSMAN)
+ ZIPPER=		gzip --force
+ UNZIPPER=	gunzip --force
+ ZSUFFIX=	.gz
+ .else
+ ZIPPER=		:
+ UNZIPPER=	:
+ ZSUFFIX=
+ .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${ZSUFFIX}; \
! 		${ZIPPER} $$page; \
! 		page=$$page${ZSUFFIX}; \
  		echo ${MINSTALL} $$page $$instpage; \
  		${MINSTALL} $$page $$instpage; \
+ 		${UNZIPPER} $$page; \
  	done
  .endif
  .if defined(MLINKS) && !empty(MLINKS)
***************
*** 42,50 ****
  		shift; \
  		dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
  		t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0; \
! 		echo $$t -\> $$l; \
! 		rm -f $$t; \
! 		ln $$l $$t; \
  	done; true
  .endif
  
--- 56,64 ----
  		shift; \
  		dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
  		t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0; \
!  		echo $${t}${ZSUFFIX} -\> $${l}${ZSUFFIX}; \
!  		rm -f $${t}${ZSUFFIX} $$t; \
!  		ln $${l}${ZSUFFIX} $${t}${ZSUFFIX}; \
  	done; true
  .endif