'Make adjustments to the OpenFOAM configuration files in their various
locations: etc/bashrc, etc/config.sh/FEATURE and customizations that
don\'t properly fit get placed in the etc/prefs.sh file (similiarly for
csh).'

def configure(self, spec, prefix):

    edits = {}
    edits.update(self.foam_arch.foam_dict())
    rewrite_environ_files(edits, posix=join_path('etc', 'bashrc'), cshell=join_path('etc', 'cshrc'))
    user_mpi = mplib_content(spec)
    self.etc_prefs = {'MPI_ROOT': spec['mpi'].prefix, 'MPI_ARCH_FLAGS': ('"%s"' % user_mpi['FLAGS']), 'MPI_ARCH_INC': ('"%s"' % user_mpi['PINC']), 'MPI_ARCH_LIBS': ('"%s"' % user_mpi['PLIBS'])}
    self.etc_config = {'CGAL': {}, 'scotch': {}, 'metis': {}, 'paraview': [], 'gperftools': []}
    if True:
        self.etc_config['scotch'] = {'SCOTCH_ARCH_PATH': spec['scotch'].prefix, 'SCOTCH_VERSION': 'scotch-{0}'.format(spec['scotch'].version)}
    if self.etc_prefs:
        write_environ(self.etc_prefs, posix=join_path('etc', 'prefs.sh'), cshell=join_path('etc', 'prefs.csh'))
    for (component, subdict) in self.etc_config.items():
        write_environ(subdict, posix=join_path('etc', 'config.sh', component), cshell=join_path('etc', 'config.csh', component))
