added tmpdir support to grammar packer