'Install under the projectdir'

def install(self, spec, prefix):

    opts = str(self.foam_arch)
    appdir = 'applications'
    projdir = os.path.basename(self.projectdir)
    mkdirp(self.projectdir, join_path(self.projectdir, appdir))
    edits = {'WM_PROJECT_INST_DIR': os.path.dirname(self.projectdir), 'WM_PROJECT_DIR': join_path('$WM_PROJECT_INST_DIR', projdir)}
    if ('+source' in spec):
        ignored = re.compile('^spack-.*')
    else:
        ignored = re.compile('^(Allclean|Allwmake|spack-).*')
    files = [f for f in glob.glob('*') if (os.path.isfile(f) and (not ignored.search(f)))]
    for f in files:
        install(f, self.projectdir)
    for d in ['etc', 'bin', 'wmake', 'lib', join_path(appdir, 'bin')]:
        install_tree(d, join_path(self.projectdir, d), symlinks=True)
    if ('+source' in spec):
        subitem = join_path(appdir, 'Allwmake')
        install(subitem, join_path(self.projectdir, subitem))
        ignored = [opts]
        for d in ['src', 'tutorials']:
            install_tree(d, join_path(self.projectdir, d), ignore=shutil.ignore_patterns(*ignored), symlinks=True)
        for d in ['solvers', 'utilities']:
            install_tree(join_path(appdir, d), join_path(self.projectdir, appdir, d), ignore=shutil.ignore_patterns(*ignored), symlinks=True)
    etc_dir = join_path(self.projectdir, 'etc')
    rewrite_environ_files(edits, posix=join_path(etc_dir, 'bashrc'), cshell=join_path(etc_dir, 'cshrc'))
    self.install_links()
