To be honest, the package_dir stuff comes from bcourt's research into distributions. I'm not entirely sure what's going on either, I simply emulated the changes he made to _publish_rpms here.