def main():

    global PWD_INDICO_CONF
    global eggDir

    optlist, args = getopt.getopt(sys.argv[1:],'',['rpm','existing-config=',
                                                   'www-uid=','www-gid='])

    wwwUid = None
    wwwGid = None

    forRPM = False
    existingPath = None

    for o,a in optlist:
        if o == '--rpm':
            forRPM = True
        elif o == '--existing-config':
            existingPath = a
        elif o == "--www-uid":
            wwwUid = a
        elif o == "--www-gid":
            wwwGid = a

    setIndicoInstallMode(True)

    if forRPM:
        # TODO: post-install for RPMs
        pass
    else:
        targetDirs = { 'etc': '/opt/indico/etc' }
        PWD_INDICO_CONF = os.path.join(os.path.dirname(__file__), '..', '..', 'etc', 'indico.conf.sample')

        targetDirs = indico_pre_install('/opt/indico', False, existingConfig=existingPath)
        # we need to copy htdocs/ bin/ doc/ etc/ to its proper place
        print "Copying Indico tree... "
        copy_egg_datafiles_to_base(targetDirs)
        if hasattr(os, 'symlink'):
            wsgi_file = os.path.join(targetDirs['htdocs'], 'indico.wsgi')
            print "Creating wsgi symlink... %s" % wsgi_file
            if os.path.exists(wsgi_file) or os.path.islink(wsgi_file):
                os.unlink(wsgi_file)
            os.symlink(os.path.join(eggDir, 'indico/web/indico.wsgi'), wsgi_file)
        print "done!"


    sourceDirs = dict((dirName, os.path.join(eggDir, dirName))
                      for dirName in ['bin','doc','etc','htdocs'])

    indico_post_install(targetDirs,
                        sourceDirs,
                        os.path.join(os.path.abspath(os.path.dirname(__file__)),
                                     '..',
                                     'common'),
                        eggDir,
                        force_no_db=(existingPath != None),
                        uid = wwwUid,
                        gid = wwwGid)
示例#2
0
def main():

    global PWD_INDICO_CONF
    global eggDir

    optlist, args = getopt.getopt(sys.argv[1:], '',
                                  ['rpm', 'existing-config='])

    forRPM = False
    existingPath = None

    for o, a in optlist:
        if o == '--rpm':
            forRPM = True
        elif o == '--existing-config':
            existingPath = a

    setIndicoInstallMode(True)

    if forRPM:
        # TODO: post-install for RPMs
        pass
    else:
        targetDirs = {'etc': '/opt/indico/etc'}
        PWD_INDICO_CONF = os.path.join(os.path.dirname(__file__), '..', '..',
                                       'etc', 'indico.conf.sample')

        targetDirs = indico_pre_install('/opt/indico',
                                        False,
                                        existingConfig=existingPath)
        # we need to copy htdocs/ bin/ doc/ etc/ to its proper place
        print "Copying Indico tree... "
        copy_egg_datafiles_to_base(targetDirs)
        print "done!"

    sourceDirs = dict((dirName, os.path.join(eggDir, dirName))
                      for dirName in ['bin', 'doc', 'etc', 'htdocs'])

    indico_post_install(targetDirs,
                        sourceDirs,
                        os.path.join(
                            os.path.abspath(os.path.dirname(__file__)), '..',
                            'common'),
                        eggDir,
                        force_no_db=(existingPath != None))
def main():

    global PWD_INDICO_CONF
    global eggDir

    optlist, args = getopt.getopt(sys.argv[1:],'',['rpm','existing-config='])

    forRPM = False
    existingPath = None

    for o,a in optlist:
        if o == '--rpm':
            forRPM = True
        elif o == '--existing-config':
            existingPath = a

    setIndicoInstallMode(True)

    if forRPM:
        # TODO: post-install for RPMs
        pass
    else:
        targetDirs = { 'etc': '/opt/indico/etc' }
        PWD_INDICO_CONF = os.path.join(os.path.dirname(__file__), '..', '..', 'etc', 'indico.conf.sample')

        targetDirs = indico_pre_install('/opt/indico', False, existingConfig=existingPath)
        # we need to copy htdocs/ bin/ doc/ etc/ to its proper place
        print "Copying Indico tree... "
        copy_egg_datafiles_to_base(targetDirs)
        print "done!"


    sourceDirs = dict((dirName, os.path.join(eggDir, dirName))
                      for dirName in ['bin','doc','etc','htdocs'])

    indico_post_install(targetDirs,
                        sourceDirs,
                        os.path.join(os.path.abspath(os.path.dirname(__file__)),
                                     '..',
                                     'common'),
                        eggDir,
                        force_no_db=(existingPath != None))