def create_debianization(distribution):
    if exists('debian'):
        raise NotImplementedError()

    # default values
    name = distribution.get_name()
    name = 'python-%s' % name.replace('_', '-').lower()

    maintainer = distribution.get_maintainer()
    maintainer_email = distribution.get_maintainer_email()
    if maintainer == 'UNKNOWN':
        maintainer = 'CH content team'
    if maintainer_email == 'UNKNOWN':
        maintainer_email = 'pg-content-dev@chconf.com'
    maintainer = '%s <%s>' % (maintainer, maintainer_email)

    version = distribution.get_version()
    if not version:
        version = '0.0.0'

    # get current date in proper format
    now = datetime.now()
    utcnow = datetime.utcnow()
    tzdiff = get_tzdiff(now, utcnow)
    nowstring = '%s %s' % (now.strftime('%a, %d %b %Y %H:%M:%S'), tzdiff)

    description = distribution.get_description()
    description = description.strip().replace('\n', '\n ')

    architecture = 'all'
    if distribution.has_ext_modules():
        architecture = 'any'

    # replace all occurences in debian template dir
    copytree(join(dirname(__file__), 'default_debianization'), 'debian')
    # do the replacement in template dir
    for root, dirs, files in os.walk('debian'):
        for f in files:
            file = join(root, f)
            with open(file) as fin:
                content = fin.read()

            for key, value in (
                ('#NAME#', name),
                ('#MAINTAINER#', maintainer),
                ('#VERSION#', version),
                ('#DATE#', nowstring),
                ):
                content = content.replace(key, value)

            with open(file, 'w') as fout:
                fout.write(content)

    # update control file
    cf = ControlFile(filename='debian/control')
    src = cf.source
    p = cf.packages[0]

    src['Source'] = p['Package'] = name
    src['Maintainer'] = maintainer
    p['Description'] = description
    p['Architecture'] = architecture

    install_requires = distribution.install_requires
    if install_requires:
        for package in install_requires:
            p['Depends'].append(parse_setuppy_dependency(package))
    cf.dump('debian/control')
dataset/ETHPy150Open ella/citools/citools/debian/commands.py/create_debianization/original