fix version detection for packaging, refs #1275, #1276