def METHOD_NAME(revision,
            target_zip_dir=constants.PACKAGE_TARGET_ZIP_DIRECTORY,
            target_manifest_path=constants.PACKAGE_TARGET_MANIFEST_PATH,
            platform_name=None,
            python3=False):
  """Prepare clusterfuzz-source.zip."""
  is_ci = os.getenv('TEST_BOT_ENVIRONMENT')
  if not is_ci and common.is_git_dirty():
    print('Your branch is dirty. Please fix before packaging.')
    sys.exit(1)
  if not _is_nodejs_up_to_date():
    print('You do not have nodejs, or your nodejs is not at least version 4.')
    sys.exit(1)
  common.install_dependencies(platform_name=platform_name)
  # This needs to be done before packaging step to let src/appengine/config be
  # archived for bot.
  appengine.symlink_dirs()
  _, ls_files_output = common.execute('git -C . ls-files', print_output=False)
  file_paths = [path.decode('utf-8') for path in ls_files_output.splitlines()]
  if not os.path.exists(target_zip_dir):
    os.makedirs(target_zip_dir)
  target_zip_name = constants.LEGACY_ZIP_NAME
  if platform_name:
    if python3:
      target_zip_name = platform_name + '-3.zip'
    else:
      target_zip_name = platform_name + '.zip'
  target_zip_path = os.path.join(target_zip_dir, target_zip_name)
  _clear_zip(target_zip_path)
  output_file = zipfile.ZipFile(target_zip_path, 'w', zipfile.ZIP_DEFLATED)
  # Add files from git.
  for file_path in file_paths:
    if (file_path.startswith('config') or file_path.startswith('local') or
        file_path.startswith(os.path.join('src', 'appengine')) or
        file_path.startswith(os.path.join('src', 'local')) or
        file_path.startswith(
            os.path.join('src', 'clusterfuzz', '_internal', 'tests'))):
      continue
    _add_to_zip(output_file, file_path)
  # These are project configuration yamls.
  for path in _get_files(os.path.join('src', 'appengine', 'config')):
    _add_to_zip(output_file, path)
  # These are third party dependencies.
  for path in _get_files(os.path.join('src', 'third_party')):
    _add_to_zip(output_file, path)
  output_file.close()
  with open(target_manifest_path, 'w') as f:
    f.write('%s\n' % revision)
  with zipfile.ZipFile(target_zip_path, 'a', zipfile.ZIP_DEFLATED) as f:
    _add_to_zip(f, target_manifest_path, constants.PACKAGE_TARGET_MANIFEST_PATH)
  print('Revision: %s' % revision)
  print()
  print('%s is ready.' % target_zip_path)
  return target_zip_path