# Break the /usr/share/pkgconfig symlinks, if it exists.
# Then move the .pc files to the standard location.
if [ -L usr/share/pkgconfig ]; then
  rm usr/share/pkgconfig
  mkdir -p usr/share/pkgconfig
  grep usr/share/pkgconfig var/log/packages/* | grep '\.pc$' | cut -f 2 -d : | cut -f 4 -d / | while read movefile ; do
    mv usr/lib64/pkgconfig/$movefile usr/share/pkgconfig 1> /dev/null 2> /dev/null
  done
fi
( cd usr/bin ; rm -rf pkg-config )
( cd usr/bin ; ln -sf pkgconf pkg-config )
( cd usr/lib64 ; rm -rf libpkgconf.so )
( cd usr/lib64 ; ln -sf libpkgconf.so.8.0.0 libpkgconf.so )
( cd usr/lib64 ; rm -rf libpkgconf.so.8 )
( cd usr/lib64 ; ln -sf libpkgconf.so.8.0.0 libpkgconf.so.8 )
( cd usr/man/man1 ; rm -rf pkg-config.1.gz )
( cd usr/man/man1 ; ln -sf pkgconf.1.gz pkg-config.1.gz )
