@classmethod<EOL><INDENT>def build_includes(cls, include_packages):<DEDENT>
includes, package_root_paths = cls._split_packages(include_packages)<EOL>for package_path, package_name in six.iteritems(package_root_paths):<EOL><INDENT>if re.search(r'<STR_LIT>', package_path):<EOL><INDENT>package_files = set([os.path.dirname(package_path)])<EOL>for root, dirs, files in os.walk(os.path.dirname(package_path)):<EOL><INDENT>if '<STR_LIT>' in files:<EOL><INDENT>package_files.add(root)<EOL><DEDENT><DEDENT>if len(package_files) > <NUM_LIT:1>:<EOL><INDENT>common_prefix = os.path.commonprefix(package_files)<EOL>common_dir = os.path.dirname(common_prefix)<EOL>package_tails = set([f[len(common_dir) + len(os.sep):] for f in package_files])<EOL>package_names = set([tail.replace(os.sep, '<STR_LIT:.>') for tail in package_tails])<EOL>package_names_with_star = set([pkg + '<STR_LIT>' if pkg != package_name else pkg for pkg in package_names])<EOL>includes |= package_names_with_star<EOL><DEDENT>else:<EOL><INDENT>includes.add(package_name)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>includes.add(package_name)<EOL><DEDENT><DEDENT>return includes<EOL>
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