Backport --pkginfodir support from trunk.