def build_includes(cls, include_packages):
        """
        The default include strategy is to add a star (*) wild card after all sub-packages (but not the main package).
        This strategy is compatible with py2app and bbfreeze.

        Example (From SaltStack 2014.7):

            salt
            salt.fileserver.*
            salt.modules.*
            etc...

        :param include_packages: List of package references to recurse for subpackages
        """
        includes, package_root_paths = cls._split_packages(include_packages)
        for package_path, package_name in six.iteritems(package_root_paths):
            if re.search(r'__init__.py.*$', package_path):
                # Looks like a package.  Walk the directory and see if there are more.
                package_files = set([os.path.dirname(package_path)])
                for root, dirs, files in os.walk(os.path.dirname(package_path)):
                    if '__init__.py' in files:
                        package_files.add(root)

                if len(package_files) > 1:
                    common_prefix = os.path.commonprefix(package_files)
                    common_dir = os.path.dirname(common_prefix)
                    package_tails = set([f[len(common_dir) + len(os.sep):] for f in package_files])
                    package_names = set([tail.replace(os.sep, '.') for tail in package_tails])
                    package_names_with_star = set([pkg + '.*' if pkg != package_name else pkg for pkg in package_names])
                    includes |= package_names_with_star

                else:
                    # No sub-packages.  Just add the package name by itself.
                    includes.add(package_name)
            else:
                # Not a package.  Just add the module.
                includes.add(package_name)

        return includes
The default include strategy is to add a star (*) wild card after all sub-packages (but not the main package).
        This strategy is compatible with py2app and bbfreeze.

        Example (From SaltStack 2014.7):

            salt
            salt.fileserver.*
            salt.modules.*
            etc...

        :param include_packages: List of package references to recurse for subpackages