Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2003 00:14:07 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@freebsd.org
Subject:   Re: HEADS UP: bzip2(1) compression for manpages, Groff and Texinfo docs
Message-ID:  <20030502071407.GB3258@dragon.nuxi.com>
In-Reply-To: <20030502014308.GA92123@rot13.obsecurity.org>
References:  <20030502011307.GA82420@sunbay.com> <20030502014308.GA92123@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.)
>=20
> 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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
@@ -2145,7 +2151,13 @@
 MANLANG?=3D	""	# english only by default
=20
 .if !defined(NOMANCOMPRESS)
-MANEXT=3D	.gz
+.if defined(WANT_GZPKG)
+MCOMPRESS_CMD=3D	${GZIP_CMD}
+MCOMPRESS_EXT=3D	.gz
+.else
+MCOMPRESS_CMD=3D	${BZIP2_CMD}
+MCOMPRESS_EXT=3D	.bz2
+.endif
 .endif
=20
 .if (defined(MLINKS) || defined(_MLINKS_PREPEND)) && !defined(_MLINKS)
@@ -2159,7 +2171,7 @@
 		else \
 			{ print "broken"; exit; } \
 	} \
-  }' | ${SED} -e 's=08 \([^/ ][^ ]*\.\(.\)[^. ]*\)=08 $${MAN\2PREFIX}/man/=
$$$$$$$${__lang}/man\2/\1${MANEXT}=08g' -e 's/ /=08/g' -e 's/MANlPREFIX/MAN=
LPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
+  }' | ${SED} -e 's=08 \([^/ ][^ ]*\.\(.\)[^. ]*\)=08 $${MAN\2PREFIX}/man/=
$$$$$$$${__lang}/man\2/\1${MCOMPRESS_EXT}=08g' -e 's/ /=08/g' -e 's/MANlPRE=
FIX/MANLPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
 .if ${__pmlinks:Mbroken} =3D=3D "broken"
 .BEGIN:
 	@${ECHO_CMD} "${PKGNAME}: Unable to parse MLINKS."
@@ -2209,11 +2221,11 @@
 .if defined(_MANPAGES) && defined(NOMANCOMPRESS)
 __MANPAGES:=3D	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g}
 .elif defined(_MANPAGES)
-__MANPAGES:=3D	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/.gz/}
+__MANPAGES:=3D	${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/${MCOMPRESS_=
EXT}/}
 .endif
=20
 .if defined(_MANPAGES) && ${MANCOMPRESSED} =3D=3D "yes"
-_MANPAGES:=3D	${_MANPAGES:S/$/.gz/}
+_MANPAGES:=3D	${_MANPAGES:S/$/${MCOMPRESS_EXT}/}
 .endif
=20
 .if ${XFREE86_VERSION} =3D=3D 3
@@ -3817,7 +3833,6 @@
 	fi; \
 	checked=3D"${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=3D$$(${REALPATH} $$dir); \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				childout=3D$$(cd $$dir; ${MAKE} CHILD_DEPENDS=3Dyes PARENT_CHECKED=3D"=
$$checked" package-depends-list); \
@@ -3995,7 +4010,7 @@
 	@${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST}
 .endif
 	@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} "@unexec rm -f %D/$${i%.gz} %D/$${i%.gz}.gz" >> ${TMPPLIST}; \
+		${ECHO} "@unexec rm -f %D/$${i%${MCOMPRESS_EXT}} %D/$${i%${MCOMPRESS_EXT=
}}${MCOMPRESS_EXT}" >> ${TMPPLIST}; \
 	done
 .if ${XFREE86_HTML_MAN} =3D=3D "yes"
 .for mansect in 1 2 3 4 5 6 7 8 9 L N
@@ -4034,16 +4049,16 @@
 .if defined(_MANPAGES) || defined(_MLINKS)
 .if ${MANCOMPRESSED} =3D=3D yes && defined(NOMANCOMPRESS)
 	@${ECHO_MSG} "=3D=3D=3D>   Uncompressing manual pages for ${PKGNAME}"
-	@_manpages=3D'${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" !=3D "" ] && =
( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE}
+	@_manpages=3D'${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" !=3D "" ] && =
( eval ${MCOMPRESS_CMD} -d $${_manpages} ) || ${TRUE}
 .elif ${MANCOMPRESSED} =3D=3D no && !defined(NOMANCOMPRESS)
 	@${ECHO_MSG} "=3D=3D=3D>   Compressing manual pages for ${PKGNAME}"
-	@_manpages=3D'${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" !=3D "" ] && =
( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE}
+	_manpages=3D'${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" !=3D "" ] && (=
 eval ${MCOMPRESS_CMD} -f $${_manpages} ) || ${TRUE}
 .endif
 .if defined(_MLINKS)
 	@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=3Dsplit($$1, a, /\//); x=3Dsplit($$2, b, /\//); \
 					while (a[i] =3D=3D b[i]) i++; \



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