def fixup_setup(setup):
  """Fill in any missing pieces from setup."""
  if not hasattr(setup, 'PY_NAME'):
    setup.PY_NAME = setup.NAME
  if not hasattr(setup, 'PY_SRC'):
    setup.PY_SRC = '%s.py' % setup.PY_NAME
  if not hasattr(setup, 'DEB_NAME'):
    setup.DEB_NAME = setup.NAME
  if not hasattr(setup, 'AUTHOR_NAME'):
    setup.AUTHOR_NAME = setup.SETUP['author']
  if not hasattr(setup, 'GOOGLE_CODE_EMAIL'):
    setup.GOOGLE_CODE_EMAIL = setup.SETUP['author_email']
  return setup