# Path: py2man/manpages.py
# EXAMPLEHEADER = '''.SH Example'''
# class ManPage(object):
#     def __init__(self, prog, version, template, docpath, authors):
#     def ensure_docdir(self):
#     def gen_opts(options):
#     def gen_optsStr(firstline, data, opts):
#     def gen_brlist(_list):
#     def gen_actions(actions):
#     def gen_options(options):
#     def gen_example(text):
#     def gen_subcmd(cmds):
#     def make_subpage(self, action, Action_Map, _actions):
#     def make_subpages(self, Action_Map, actions):
#     def make_prog(self, prog_map):
#     def read_template(self, path, filename):


import os
import sys
from distutils.core import setup, Command
from distutils.command.build import build
from distutils.command.sdist import sdist
from glob import glob
from gkeygen import __version__, __license__
from gkeygen import Gkeys_Map
from gkeygen.actions import Action_Map, Available_Actions
from py2man import manpages
    from portage.const import EPREFIX
except ImportError:
    EPREFIX=''


class x_build(build):
    """ Build command with extra build_man call. """

    def run(self):
        build.run(self)
        self.run_command('build_man')


class build_man(Command):
    """ Perform substitutions in manpages. """

    user_options = [
    ]

    def initialize_options(self):
        self.build_base = None

    def finalize_options(self):
        self.set_undefined_options('build',
            ('build_base', 'build_base'))

    def run(self):
        # create the main page
        basepath = os.path.dirname(__file__)
        docpath = os.path.join(basepath, 'doc')
        templatepath = os.path.dirname(manpages.__file__)

# Path: py2man/manpages.py
# EXAMPLEHEADER = '''.SH Example'''
# class ManPage(object):
#     def __init__(self, prog, version, template, docpath, authors):
#     def ensure_docdir(self):
#     def gen_opts(options):
#     def gen_optsStr(firstline, data, opts):
#     def gen_brlist(_list):
#     def gen_actions(actions):
#     def gen_options(options):
#     def gen_example(text):
#     def gen_subcmd(cmds):
#     def make_subpage(self, action, Action_Map, _actions):
#     def make_subpages(self, Action_Map, actions):
#     def make_prog(self, prog_map):
#     def read_template(self, path, filename):


# Path: gkeys-gen/setup.py
import os
import sys
from distutils.core import setup, Command
from distutils.command.build import build
from distutils.command.sdist import sdist
from glob import glob
from gkeygen import __version__, __license__
from gkeygen import Gkeys_Map
from gkeygen.actions import Action_Map, Available_Actions
from py2man import manpages
    from portage.const import EPREFIX

except ImportError:
    EPREFIX=''


class x_build(build):
    """ Build command with extra build_man call. """

    def run(self):
        build.run(self)
        self.run_command('build_man')


class build_man(Command):
    """ Perform substitutions in manpages. """

    user_options = [
    ]

    def initialize_options(self):
        self.build_base = None

    def finalize_options(self):
        self.set_undefined_options('build',
            ('build_base', 'build_base'))

    def run(self):
        # create the main page
        basepath = os.path.dirname(__file__)
        docpath = os.path.join(basepath, 'doc')
        templatepath = os.path.dirname(manpages.__file__)

        man = manpages.ManPage('gkeys-gen', __version__, None,