def main()

in pkg/private/deb/make_deb.py [0:0]


def main():
  parser = argparse.ArgumentParser(
      description='Helper for building deb packages')

  parser.add_argument('--output', required=True,
                      help='The output file, mandatory')
  parser.add_argument('--changes', required=True,
                      help='The changes output file, mandatory.')
  parser.add_argument('--data', required=True,
                      help='Path to the data tarball, mandatory')
  parser.add_argument(
      '--preinst',
      help='The preinst script (prefix with @ to provide a path).')
  parser.add_argument(
      '--postinst',
      help='The postinst script (prefix with @ to provide a path).')
  parser.add_argument(
      '--prerm',
      help='The prerm script (prefix with @ to provide a path).')
  parser.add_argument(
      '--postrm',
      help='The postrm script (prefix with @ to provide a path).')
  parser.add_argument(
      '--config',
      help='The config script (prefix with @ to provide a path).')
  parser.add_argument(
      '--templates',
      help='The templates file (prefix with @ to provide a path).')
  parser.add_argument(
      '--triggers',
      help='The triggers file (prefix with @ to provide a path).')
  # see
  # https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html#s-conffile
  parser.add_argument(
      '--conffile', action='append',
      help='List of conffiles (prefix item with @ to provide a path)')
  AddControlFlags(parser)
  options = parser.parse_args()

  CreateDeb(
      options.output,
      options.data,
      preinst=helpers.GetFlagValue(options.preinst, False),
      postinst=helpers.GetFlagValue(options.postinst, False),
      prerm=helpers.GetFlagValue(options.prerm, False),
      postrm=helpers.GetFlagValue(options.postrm, False),
      config=helpers.GetFlagValue(options.config, False),
      templates=helpers.GetFlagValue(options.templates, False),
      triggers=helpers.GetFlagValue(options.triggers, False),
      conffiles=GetFlagValues(options.conffile),
      package=options.package,
      version=helpers.GetFlagValue(options.version),
      description=helpers.GetFlagValue(options.description),
      maintainer=helpers.GetFlagValue(options.maintainer),
      section=options.section,
      architecture=helpers.GetFlagValue(options.architecture),
      depends=GetFlagValues(options.depends),
      suggests=options.suggests,
      enhances=options.enhances,
      preDepends=options.pre_depends,
      recommends=options.recommends,
      replaces=options.replaces,
      provides=options.provides,
      homepage=helpers.GetFlagValue(options.homepage),
      builtUsing=helpers.GetFlagValue(options.built_using),
      priority=options.priority,
      conflicts=options.conflicts,
      breaks=options.breaks,
      installedSize=helpers.GetFlagValue(options.installed_size))
  CreateChanges(
      output=options.changes,
      deb_file=options.output,
      architecture=options.architecture,
      short_description=helpers.GetFlagValue(options.description).split('\n')[0],
      maintainer=helpers.GetFlagValue(options.maintainer), package=options.package,
      version=helpers.GetFlagValue(options.version), section=options.section,
      priority=options.priority, distribution=options.distribution,
      urgency=options.urgency)