3 # If using normal root, avoid changing anything.
4 if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
14 for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
15 ./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
16 ./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
17 ./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
20 for f in `find $d -type f`
22 [ -f "$f" ] || continue
23 [ "`basename $f`" = "dir" ] && continue
26 *.gz|*.Z) gunzip $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
27 *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
28 *.xz|*.lzma) unxz $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
32 $COMPRESS $b </dev/null 2>/dev/null || {
33 inode=`ls -i $b | awk '{ print $1 }'`
34 others=`find $d -type f -inum $inode`
35 if [ -n "$others" ]; then
36 for afile in $others ; do
37 [ "$afile" != "$b" ] && rm -f $afile
40 for afile in $others ; do
41 [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
49 for f in `find $d -type l`
51 l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
53 b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
54 ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT