head	1.12;
access;
symbols
	rpm-4_4_8-release:1.12
	rpm-4_4_7-release:1.12
	rpm-4_4_6-release:1.12
	rpm-4_4_5-release:1.12
	rpm-4_4_4-release:1.12
	rpm-4_4_3-release:1.12
	jbj_before_tklcpatches:1.12
	rpm-4_4_2-release:1.12
	pjones-sparse-experiment:1.12.0.4
	rpm-4_4_1-release:1.12
	rpm-4_4-release:1.12
	rpm-4_4:1.12.0.2
	rpm-4_3_1-start:1.11
	rpm-4_3:1.11.0.6
	rpm-4_2_1-release:1.11.4.1
	rpm-4_1_1-release:1.11
	rpm-4_2-release:1.11
	rpm-4_2:1.11.0.4
	rpm-4_1-release:1.11
	rpm-4_1:1.11.0.2
	rpm-4_0_4-release:1.9.2.1
	jbj-before-beecrypt:1.9.2.1
	rpm-4_0_3-release:1.9.2.1
	jbj_b4_rollback:1.9.2.1
	rpm-4_0_2-release:1.9.2.1
	rpm-4_0_1-release:1.9.2.1
	rpm-3_0_6-release:1.3.2.3
	rpm-4_0-release:1.9
	rpm-3_0_6:1.3.2.3
	rpm-4_0:1.9.0.2
	rpm-3_0_5:1.3.2.3.0.2
	jbj_sparc64:1.4.0.2
	rpm-3_0_4:1.3.0.2;
locks; strict;
comment	@# @;


1.12
date	2004.10.17.18.49.52;	author jbj;	state Exp;
branches;
next	1.11;

1.11
date	2001.11.24.15.36.50;	author jbj;	state Exp;
branches
	1.11.4.1
	1.11.6.1;
next	1.10;

1.10
date	2000.12.02.21.53.45;	author jbj;	state Exp;
branches;
next	1.9;

1.9
date	2000.07.22.14.14.07;	author jbj;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2000.07.22.14.06.32;	author jbj;	state Exp;
branches;
next	1.7;

1.7
date	2000.07.18.15.31.26;	author jbj;	state Exp;
branches;
next	1.6;

1.6
date	2000.06.20.21.45.52;	author jbj;	state Exp;
branches;
next	1.5;

1.5
date	2000.06.20.14.20.07;	author jbj;	state Exp;
branches;
next	1.4;

1.4
date	2000.05.22.17.33.32;	author jbj;	state Exp;
branches;
next	1.3;

1.3
date	2000.02.10.00.27.21;	author jbj;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2000.02.06.18.07.12;	author jbj;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.07.17.32.28;	author jbj;	state Exp;
branches;
next	;

1.3.2.1
date	2000.06.20.14.22.00;	author jbj;	state Exp;
branches;
next	1.3.2.2;

1.3.2.2
date	2000.06.20.21.45.36;	author jbj;	state Exp;
branches;
next	1.3.2.3;

1.3.2.3
date	2000.07.20.04.37.18;	author jbj;	state Exp;
branches;
next	;

1.9.2.1
date	2000.12.01.00.17.03;	author jbj;	state Exp;
branches;
next	;

1.11.4.1
date	2003.09.08.20.45.33;	author jbj;	state Exp;
branches;
next	;

1.11.6.1
date	2004.10.17.18.52.02;	author jbj;	state Exp;
branches;
next	;


desc
@@


1.12
log
@- don't add time stamp to compressed man pages (#132526).
@
text
@#!/bin/sh

# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
	exit 0
fi

cd $RPM_BUILD_ROOT

# Compress man pages
COMPRESS="gzip -9 -n"
COMPRESS_EXT=.gz

for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
	./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
	./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
	./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
    [ -d $d ] || continue
    for f in `find $d -type f`
    do
        [ -f "$f" ] || continue
	[ "`basename $f`" = "dir" ] && continue

	case "$f" in
	 *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
	 *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
	 *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
	 *) b=$f;;
	esac

	$COMPRESS $b </dev/null 2>/dev/null || {
	    inode=`ls -i $b | awk '{ print $1 }'`
	    others=`find $d -type f -inum $inode`
	    if [ -n "$others" ]; then
		for afile in $others ; do
		    [ "$afile" != "$b" ] && rm -f $afile
		done
		$COMPRESS -f $b
		for afile in $others ; do
		    [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
		done
	    else
		$COMPRESS -f $b
	    fi
	}
    done

    for f in `find $d -type l`
    do
	l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
	rm -f $f
	b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
	ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
    done
done
@


1.11
log
@- protect brp-compress against /bin/ls output ambiguity (#56656,#56336).
@
text
@d11 1
a11 1
COMPRESS="gzip -9"
@


1.11.6.1
log
@- don't add time stamp to compressed man pages (#132526).
@
text
@d11 1
a11 1
COMPRESS="gzip -9 -n"
@


1.11.4.1
log
@Add -n flag.
@
text
@d11 1
a11 1
COMPRESS="gzip -9 -n"
@


1.10
log
@Bring header reggions mods back to top of stack.
@
text
@d51 1
a51 1
	l=`ls -l $f | awk '{ print $11 }' | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
@


1.9
log
@Add ./usr/lib/*/man/man*.
@
text
@d32 1
a32 1
	$COMPRESS $b 2>/dev/null || {
@


1.9.2.1
log
@- add missing headerFree for legacy signature header.
- fix: removed packages leaked DIRINDEXES tag data.
- reload tags added during install when loading header from rpmdb.
- avoid brp-compress hang with both compressed/uncompressed man pages.
@
text
@d32 1
a32 1
	$COMPRESS $b </dev/null 2>/dev/null || {
@


1.8
log
@Add ./usr/share/doc/*/man/man*
@
text
@d17 1
a17 1
	./usr/share/doc/*/man/man*
@


1.7
log
@Add /usr/kerberos/man.
@
text
@d16 2
a17 1
	./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
@


1.6
log
@- add RPMTAG_OPTFLAGS, configured optflags when package was built.
- add RPMTAG_DISTURL for rpmfind-like tools (content unknown yet).
- teach brp-compress about /usr/info and /usr/share/info as well.
- update macros.in from rpm-4.0 (w/o dbi configuration).
@
text
@d16 1
a16 1
	./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
@


1.5
log
@fix: typo in brp-compress caused i18n man pages not to compress.
@
text
@d14 2
a15 2
for d in ./usr/man/man* ./usr/man/*/man* \
	./usr/share/man/man* ./usr/share/man/*/man* \
d21 25
a45 23
        if [ -f "$f" ]; then 
	    case "$f" in
	     *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
	     *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
	     *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
	     *) b=$f;;
	    esac
	    $COMPRESS $b 2>/dev/null || {
	    	inode=`ls -i $b | awk '{ print $1 }'`
		others=`find $d -type f -inum $inode`
		if [ -n "$others" ]; then
		    for afile in $others ; do
			[ "$afile" != "$b" ] && rm -f $afile
		    done
		    $COMPRESS -f $b
		    for afile in $others ; do
		        [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
		    done
		else
		    $COMPRESS -f $b
		fi
	    }
	fi
d47 1
@


1.4
log
@Add /usr/share compression as well.
@
text
@d15 1
a15 1
	./usr/share/man/man* ./usr/share/ma/*/man* \
@


1.3
log
@brp-compress deals with hard links correctly.
patch for ja.po.
@
text
@d2 1
d14 3
a16 1
for d in ./usr/man/man* ./usr/man/*/man* ./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
@


1.3.2.1
log
@- update brp-* scripts from rpm-4.0.
@
text
@a1 1

d13 1
a13 3
for d in ./usr/man/man* ./usr/man/*/man* \
	./usr/share/man/man* ./usr/share/man/*/man* \
	./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
@


1.3.2.2
log
@- add RPMTAG_OPTFLAGS, configured optflags when package was built.
- add RPMTAG_DISTURL for rpmfind-like tools (content unknown yet).
- teach brp-compress about /usr/info and /usr/share/info as well.
- update macros.in from rpm-4.0 (w/o dbi configuration).
@
text
@d14 2
a15 2
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
	./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
d21 23
a43 25
        [ -f "$f" ] || continue
	[ "`basename $f`" = "dir" ] && continue

	case "$f" in
	 *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
	 *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
	 *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
	 *) b=$f;;
	esac

	$COMPRESS $b 2>/dev/null || {
	    inode=`ls -i $b | awk '{ print $1 }'`
	    others=`find $d -type f -inum $inode`
	    if [ -n "$others" ]; then
		for afile in $others ; do
		    [ "$afile" != "$b" ] && rm -f $afile
		done
		$COMPRESS -f $b
		for afile in $others ; do
		    [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
		done
	    else
		$COMPRESS -f $b
	    fi
	}
a44 1

@


1.3.2.3
log
@- fix: Red Hat 6.0 (5.2 also?) glibc-2.1.1 fclose fails using libio.
- add /usr/kerberos/man to brp-compress.
@
text
@d16 1
a16 1
	./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
@


1.2
log
@Insure compression with -9 and handle symlinks correctly.
@
text
@d18 23
a40 7
	case "$f" in
	*.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
	*.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
	*.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
	*) b=$f;;
	esac
	$COMPRESS $b
@


1.1
log
@add several BuildRoot FTW policies.
@
text
@d10 2
a11 1
COMPRESS=gzip
d16 1
a16 1
    for f in `find $d -type f | sed -e 's/[^ ]*\.gz//' -e 's/[^ ]*\.bz2//'`
d18 14
a31 1
	$COMPRESS $f
@

