Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Dec 1996 20:03:05 -0800
From:      asami@freebsd.org (Satoshi Asami)
To:        ports@freebsd.org
Subject:   bsd.port.mk support for uncompressing manpages
Message-ID:  <199612100403.UAA27959@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
This adds a new variable MANCOMPRESSED to be defined if the man page
is already compressed by the default install.  If this is defined by
the port, and NOMANCOMPRESS is defined by the user, the manpages are
uncompressed after installation.

For an example of how to use this, here's a patch to devel/cutils:

===
Index: Makefile
===================================================================
RCS file: /ccd/tmp/cvs/ports/devel/cutils/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	1996/12/08 22:57:33	1.2
+++ Makefile	1996/12/09 06:55:55
@@ -7,18 +7,15 @@
 #
 
 DISTNAME=	cutils-1.3.1
-PKGNAME=	cutils-1.3.1
 CATEGORIES=	devel
 MASTER_SITES=	ftp://freefall.FreeBSD.ORG/pub/FreeBSD/LOCAL_PORTS/
 
 MAINTAINER=	ssigala@globalnet.it
 
 HAS_CONFIGURE=	yes
-
-post-install:
-.if defined(NOMANCOMPRESS)
-	@(cd ${PREFIX} ; \
-	gunzip -f `grep man ${PKGDIR}/PLIST` )
-.endif
+MANCOMPRESSED=	yes
+MAN1=		cdecl.1 cundecl.1 chilight.1 cinfo.1 cinfoc.1 cinfodc.1 \
+		cobfusc.1 yyextract.1 yyref.1
+MAN5=		cinfodb.5
 
 .include <bsd.port.mk>
===

In case you are wondering, this is a step towards building appropriate 
PLISTs depending on the value of NOMANCOMPRESS.

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v
retrieving revision 1.235
diff -u -r1.235 bsd.port.mk
--- 1.235	1996/12/09 07:08:16
+++ bsd.port.mk	1996/12/10 03:48:59
@@ -432,6 +432,7 @@
 GZCAT?=		/usr/bin/gzcat
 GZIP?=		-9
 GZIP_CMD?=	/usr/bin/gzip -nf ${GZIP}
+GUNZIP_CMD?=	/usr/bin/gunzip -f
 SED?=		/usr/bin/sed
 
 # Used to print all the '===>' style prompts - override this to turn them off.
@@ -554,6 +555,10 @@
 _MANPAGES+=	${MANN:S.^.man/${MANLANG}/mann/.}
 .endif
 
+.if defined(_MANPAGES) && defined(MANCOMPRESSED)
+_MANPAGES:=	${_MANPAGES:S/$/.gz/}
+.endif
+
 .MAIN: all
 
 ################################################################
@@ -972,11 +977,18 @@
 		  X11BASE=${X11BASE} \
 			/bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
 	fi
-.if make(real-install) && defined(_MANPAGES) && !defined(NOMANCOMPRESS)
+.if make(real-install) && defined(_MANPAGES)
+.if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
+	@${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"
+.for manpage in ${_MANPAGES}
+	@${GUNZIP_CMD} ${MANPREFIX}/${manpage}
+.endfor
+.elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
 	@${ECHO_MSG} "===>   Compressing manual pages for ${PKGNAME}"
 .for manpage in ${_MANPAGES}
 	@${GZIP_CMD} ${MANPREFIX}/${manpage}
 .endfor
+.endif
 .endif
 .if make(real-install) && !defined(NO_PKG_REGISTER)
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612100403.UAA27959>