#!/bin/sh for d in $RPM_BUILD_ROOT/usr/lib{,64}/perl5 $RPM_BUILD_ROOT/usr/share/perl5;do [ -d $d ] || continue find $d -name ".packlist" | xargs rm -f # remove file alike /usr/lib/perl5/5.8.*/i386-linux-thread-multi/perllocal.pod perl -MConfig -e 'unlink "$ENV{RPM_BUILD_ROOT}$Config{installarchlib}/perllocal.pod"' for i in $(find $d -name "*.bs"); do if [ -s $i ]; then echo "non empty .bs file, please mail rgarciasuarez@mandriva.com about this!" else rm -f $i fi done find $d -depth -mindepth 2 -type d -empty -exec rmdir {} \; done