File djgpp-install-post.sh of Package djgpp-filesystem

#!/bin/bash

# This script does the post install tasks specific for djgpp-*
# packages.

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

LC_ALL=
LANG=
LC_TIME=POSIX

cd $RPM_BUILD_ROOT

[ -z "$STRIP" ] && STRIP=i586-pc-msdosdjgpp-strip

for f in `find . -type f -name "*.exe" -or -name "*.dll"`; do
	case $(i586-pc-msdosdjgpp-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
	    *debuglink*) continue ;;
	    *debug*) ;;
	    *gnu.version*)
		echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!"
		continue
		;;
	    *) continue ;;
	esac

    $STRIP --strip-unneeded $f;
done
for f in `find . -type f -name "*.a"`; do
	chmod -x $f;
done
for f in `find . -name "*.la"`; do
	rm -f $f;
done

if [ -d "$RPM_BUILD_ROOT/usr/i586-pc-msdosdjgpp/sys-root/mingw/share/man" ]; then
    pushd $RPM_BUILD_ROOT/usr/i586-pc-msdosdjgpp/sys-root/mingw/share/man
    for f in `find -type f`; do
	    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
        gzip -9 -n $b
    done
	popd
fi
    
openSUSE Build Service is sponsored by