Re: HEADS UP: bzip2(1) compression for manpages, Groff and Texinfo docs

From: David O'Brien <obrien_at_freebsd.org>
Date: Fri, 2 May 2003 00:14:07 -0700
On Thu, May 01, 2003 at 06:43:08PM -0700, Kris Kennaway wrote:
> On Fri, May 02, 2003 at 04:13:07AM +0300, Ruslan Ermilov wrote:
> > This is just an announcement that I'm going to add bzip2(1)
> > support to man(1) and makewhatis(1) (catman(1) already has
> > it), and then switch the default compression method from
> > gzip(1) to bzip2(1), for manpages, Groff and Texinfo docs.
> > (The latest 4.5 texinfo supports bzip2.)
> 
> I believe this will break the ports collection, which expect (and
> handles specially) gzipped manpages.

No problem, all my build ports have .bz2 manpages instead of bzip ones.

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.447
diff -u -r1.447 bsd.port.mk
--- bsd.port.mk	19 Apr 2003 22:35:28 -0000	1.447
+++ bsd.port.mk	21 Apr 2003 08:13:39 -0000
_at__at_ -2145,7 +2151,13 _at__at_
 MANLANG?=	""	# english only by default
 
 .if !defined(NOMANCOMPRESS)
-MANEXT=	.gz
+.if defined(WANT_GZPKG)
+MCOMPRESS_CMD=	${GZIP_CMD}
+MCOMPRESS_EXT=	.gz
+.else
+MCOMPRESS_CMD=	${BZIP2_CMD}
+MCOMPRESS_EXT=	.bz2
+.endif
 .endif
 
 .if (defined(MLINKS) || defined(_MLINKS_PREPEND)) && !defined(_MLINKS)
_at__at_ -2159,7 +2171,7 _at__at_
 		else \
 			{ print "broken"; exit; } \
 	} \
-  }' | ${SED} -e 's \([^/ ][^ ]*\.\(.\)[^. ]*\) $${MAN\2PREFIX}/man/$$$$$$$${__lang}/man\2/\1${MANEXT}g' -e 's/ //g' -e 's/MANlPREFIX/MANLPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
+  }' | ${SED} -e 's \([^/ ][^ ]*\.\(.\)[^. ]*\) $${MAN\2PREFIX}/man/$$$$$$$${__lang}/man\2/\1${MCOMPRESS_EXT}g' -e 's/ //g' -e 's/MANlPREFIX/MANLPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
 .if ${__pmlinks:Mbroken} == "broken"
 .BEGIN:
 	_at_${ECHO_CMD} "${PKGNAME}: Unable to parse MLINKS."
_at__at_ -2209,11 +2221,11 _at__at_
 .if defined(_MANPAGES) && defined(NOMANCOMPRESS)
 __MANPAGES:=	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g}
 .elif defined(_MANPAGES)
-__MANPAGES:=	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/.gz/}
+__MANPAGES:=	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/${MCOMPRESS_EXT}/}
 .endif
 
 .if defined(_MANPAGES) && ${MANCOMPRESSED} == "yes"
-_MANPAGES:=	${_MANPAGES:S/$/.gz/}
+_MANPAGES:=	${_MANPAGES:S/$/${MCOMPRESS_EXT}/}
 .endif
 
 .if ${XFREE86_VERSION} == 3
_at__at_ -3817,7 +3833,6 _at__at_
 	fi; \
 	checked="${PARENT_CHECKED}"; \
 	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//') $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//'); do \
-		dir=$$(${REALPATH} $$dir); \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
_at__at_ -3995,7 +4010,7 _at__at_
 	_at_${ECHO_CMD} '_at_cwd ${PREFIX}' >> ${TMPPLIST}
 .endif
 	_at_for i in $$(${ECHO} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S,^${_PREFIX}/,,:S,//,/,g} ' ' | ${SED} -E -e 's,man([1-9ln])/([^/ ]+) ,cat\1/\2 ,g'); do \
-		${ECHO} "_at_unexec rm -f %D/$${i%.gz} %D/$${i%.gz}.gz" >> ${TMPPLIST}; \
+		${ECHO} "_at_unexec rm -f %D/$${i%${MCOMPRESS_EXT}} %D/$${i%${MCOMPRESS_EXT}}${MCOMPRESS_EXT}" >> ${TMPPLIST}; \
 	done
 .if ${XFREE86_HTML_MAN} == "yes"
 .for mansect in 1 2 3 4 5 6 7 8 9 L N
_at__at_ -4034,16 +4049,16 _at__at_
 .if defined(_MANPAGES) || defined(_MLINKS)
 .if ${MANCOMPRESSED} == yes && defined(NOMANCOMPRESS)
 	_at_${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"
-	_at__manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE}
+	_at__manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${MCOMPRESS_CMD} -d $${_manpages} ) || ${TRUE}
 .elif ${MANCOMPRESSED} == no && !defined(NOMANCOMPRESS)
 	_at_${ECHO_MSG} "===>   Compressing manual pages for ${PKGNAME}"
-	_at__manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE}
+	_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${MCOMPRESS_CMD} -f $${_manpages} ) || ${TRUE}
 .endif
 .if defined(_MLINKS)
 	_at_set ${_MLINKS:S,"",,g:S,//,/,g}; \
 	while :; do \
 		[ $$# -eq 0 ] && break || ${TRUE}; \
-		${RM} -f $${2%.gz}; ${RM} -f $$2.gz; \
+		${RM} -f $${2%${MCOMPRESS_EXT}}; ${RM} -f $$2${MCOMPRESS_EXT}; \
 		${LN} -fs `${ECHO_CMD} $$1 $$2 | ${AWK} '{ \
 					z=split($$1, a, /\//); x=split($$2, b, /\//); \
 					while (a[i] == b[i]) i++; \
Received on Thu May 01 2003 - 22:14:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:05 UTC