@classmethod
def from_tarball(kls, tarball, plugin_dir, upgrade=False):
    """Create a new package from tarball file

        :type tarball: str
        :param tarball: the filename of the tarball with the plugin

        :type plugin_dir: str
        :param plugin_dir: path to install the tarball

        :type upgrade: bool
        :param upgrade: if true, upgrade the package, otherwise failed
            if package is already installed.
        """
    with open(tarball, 'rb') as f:
        return kls.from_tarballfd(f, plugin_dir, upgrade)
