install/install_tree: glob support (#18376)

* install/install_tree: glob support

* Add unit tests

* Update existing packages

* Raise error if glob finds no files, document function raises
This commit is contained in:
Adam J. Stewart 2020-09-03 12:47:19 -05:00 committed by GitHub
parent 098beee295
commit 741bb9bafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 276 additions and 370 deletions

View File

@ -337,41 +337,63 @@ def unset_executable_mode(path):
def copy(src, dest, _permissions=False): def copy(src, dest, _permissions=False):
"""Copies the file *src* to the file or directory *dest*. """Copy the file(s) *src* to the file or directory *dest*.
If *dest* specifies a directory, the file will be copied into *dest* If *dest* specifies a directory, the file will be copied into *dest*
using the base filename from *src*. using the base filename from *src*.
*src* may contain glob characters.
Parameters: Parameters:
src (str): the file to copy src (str): the file(s) to copy
dest (str): the destination file or directory dest (str): the destination file or directory
_permissions (bool): for internal use only _permissions (bool): for internal use only
Raises:
IOError: if *src* does not match any files or directories
ValueError: if *src* matches multiple files but *dest* is
not a directory
""" """
if _permissions: if _permissions:
tty.debug('Installing {0} to {1}'.format(src, dest)) tty.debug('Installing {0} to {1}'.format(src, dest))
else: else:
tty.debug('Copying {0} to {1}'.format(src, dest)) tty.debug('Copying {0} to {1}'.format(src, dest))
# Expand dest to its eventual full path if it is a directory. files = glob.glob(src)
if os.path.isdir(dest): if not files:
dest = join_path(dest, os.path.basename(src)) raise IOError("No such file or directory: '{0}'".format(src))
if len(files) > 1 and not os.path.isdir(dest):
raise ValueError(
"'{0}' matches multiple files but '{1}' is not a directory".format(
src, dest))
shutil.copy(src, dest) for src in files:
# Expand dest to its eventual full path if it is a directory.
dst = dest
if os.path.isdir(dest):
dst = join_path(dest, os.path.basename(src))
shutil.copy(src, dst)
if _permissions: if _permissions:
set_install_permissions(dest) set_install_permissions(dst)
copy_mode(src, dest) copy_mode(src, dst)
def install(src, dest): def install(src, dest):
"""Installs the file *src* to the file or directory *dest*. """Install the file(s) *src* to the file or directory *dest*.
Same as :py:func:`copy` with the addition of setting proper Same as :py:func:`copy` with the addition of setting proper
permissions on the installed file. permissions on the installed file.
Parameters: Parameters:
src (str): the file to install src (str): the file(s) to install
dest (str): the destination file or directory dest (str): the destination file or directory
Raises:
IOError: if *src* does not match any files or directories
ValueError: if *src* matches multiple files but *dest* is
not a directory
""" """
copy(src, dest, _permissions=True) copy(src, dest, _permissions=True)
@ -396,6 +418,8 @@ def copy_tree(src, dest, symlinks=True, ignore=None, _permissions=False):
If the destination directory *dest* does not already exist, it will If the destination directory *dest* does not already exist, it will
be created as well as missing parent directories. be created as well as missing parent directories.
*src* may contain glob characters.
If *symlinks* is true, symbolic links in the source tree are represented If *symlinks* is true, symbolic links in the source tree are represented
as symbolic links in the new tree and the metadata of the original links as symbolic links in the new tree and the metadata of the original links
will be copied as far as the platform allows; if false, the contents and will be copied as far as the platform allows; if false, the contents and
@ -410,26 +434,36 @@ def copy_tree(src, dest, symlinks=True, ignore=None, _permissions=False):
symlinks (bool): whether or not to preserve symlinks symlinks (bool): whether or not to preserve symlinks
ignore (function): function indicating which files to ignore ignore (function): function indicating which files to ignore
_permissions (bool): for internal use only _permissions (bool): for internal use only
Raises:
IOError: if *src* does not match any files or directories
ValueError: if *src* is a parent directory of *dest*
""" """
if _permissions: if _permissions:
tty.debug('Installing {0} to {1}'.format(src, dest)) tty.debug('Installing {0} to {1}'.format(src, dest))
else: else:
tty.debug('Copying {0} to {1}'.format(src, dest)) tty.debug('Copying {0} to {1}'.format(src, dest))
abs_src = os.path.abspath(src)
if not abs_src.endswith(os.path.sep):
abs_src += os.path.sep
abs_dest = os.path.abspath(dest) abs_dest = os.path.abspath(dest)
if not abs_dest.endswith(os.path.sep): if not abs_dest.endswith(os.path.sep):
abs_dest += os.path.sep abs_dest += os.path.sep
# Stop early to avoid unnecessary recursion if being asked to copy from a files = glob.glob(src)
# parent directory. if not files:
raise IOError("No such file or directory: '{0}'".format(src))
for src in files:
abs_src = os.path.abspath(src)
if not abs_src.endswith(os.path.sep):
abs_src += os.path.sep
# Stop early to avoid unnecessary recursion if being asked to copy
# from a parent directory.
if abs_dest.startswith(abs_src): if abs_dest.startswith(abs_src):
raise ValueError('Cannot copy ancestor directory {0} into {1}'. raise ValueError('Cannot copy ancestor directory {0} into {1}'.
format(abs_src, abs_dest)) format(abs_src, abs_dest))
mkdirp(dest) mkdirp(abs_dest)
for s, d in traverse_tree(abs_src, abs_dest, order='pre', for s, d in traverse_tree(abs_src, abs_dest, order='pre',
follow_symlinks=not symlinks, follow_symlinks=not symlinks,
@ -473,6 +507,10 @@ def install_tree(src, dest, symlinks=True, ignore=None):
dest (str): the destination directory dest (str): the destination directory
symlinks (bool): whether or not to preserve symlinks symlinks (bool): whether or not to preserve symlinks
ignore (function): function indicating which files to ignore ignore (function): function indicating which files to ignore
Raises:
IOError: if *src* does not match any files or directories
ValueError: if *src* is a parent directory of *dest*
""" """
copy_tree(src, dest, symlinks=symlinks, ignore=ignore, _permissions=True) copy_tree(src, dest, symlinks=symlinks, ignore=ignore, _permissions=True)

View File

@ -30,6 +30,9 @@ def stage(tmpdir_factory):
fs.touchp('source/c/d/5') fs.touchp('source/c/d/5')
fs.touchp('source/c/d/6') fs.touchp('source/c/d/6')
fs.touchp('source/c/d/e/7') fs.touchp('source/c/d/e/7')
fs.touchp('source/g/h/i/8')
fs.touchp('source/g/h/i/9')
fs.touchp('source/g/i/j/10')
# Create symlinks # Create symlinks
os.symlink(os.path.abspath('source/1'), 'source/2') os.symlink(os.path.abspath('source/1'), 'source/2')
@ -61,6 +64,31 @@ def test_dir_dest(self, stage):
assert os.path.exists('dest/1') assert os.path.exists('dest/1')
def test_glob_src(self, stage):
"""Test using a glob as the source."""
with fs.working_dir(str(stage)):
fs.copy('source/a/*/*', 'dest')
assert os.path.exists('dest/2')
assert os.path.exists('dest/3')
def test_non_existing_src(self, stage):
"""Test using a non-existing source."""
with fs.working_dir(str(stage)):
with pytest.raises(IOError, match='No such file or directory'):
fs.copy('source/none', 'dest')
def test_multiple_src_file_dest(self, stage):
"""Test a glob that matches multiple source files and a dest
that is not a directory."""
with fs.working_dir(str(stage)):
match = '.* matches multiple files but .* is not a directory'
with pytest.raises(ValueError, match=match):
fs.copy('source/a/*/*', 'dest/1')
def check_added_exe_permissions(src, dst): def check_added_exe_permissions(src, dst):
src_mode = os.stat(src).st_mode src_mode = os.stat(src).st_mode
@ -91,6 +119,33 @@ def test_dir_dest(self, stage):
assert os.path.exists('dest/1') assert os.path.exists('dest/1')
check_added_exe_permissions('source/1', 'dest/1') check_added_exe_permissions('source/1', 'dest/1')
def test_glob_src(self, stage):
"""Test using a glob as the source."""
with fs.working_dir(str(stage)):
fs.install('source/a/*/*', 'dest')
assert os.path.exists('dest/2')
assert os.path.exists('dest/3')
check_added_exe_permissions('source/a/b/2', 'dest/2')
check_added_exe_permissions('source/a/b/3', 'dest/3')
def test_non_existing_src(self, stage):
"""Test using a non-existing source."""
with fs.working_dir(str(stage)):
with pytest.raises(IOError, match='No such file or directory'):
fs.install('source/none', 'dest')
def test_multiple_src_file_dest(self, stage):
"""Test a glob that matches multiple source files and a dest
that is not a directory."""
with fs.working_dir(str(stage)):
match = '.* matches multiple files but .* is not a directory'
with pytest.raises(ValueError, match=match):
fs.install('source/a/*/*', 'dest/1')
class TestCopyTree: class TestCopyTree:
"""Tests for ``filesystem.copy_tree``""" """Tests for ``filesystem.copy_tree``"""
@ -111,21 +166,6 @@ def test_non_existing_dir(self, stage):
assert os.path.exists('dest/sub/directory/a/b/2') assert os.path.exists('dest/sub/directory/a/b/2')
def test_parent_dir(self, stage):
"""Test copying to from a parent directory."""
# Make sure we get the right error if we try to copy a parent into
# a descendent directory.
with pytest.raises(ValueError, match="Cannot copy"):
with fs.working_dir(str(stage)):
fs.copy_tree('source', 'source/sub/directory')
# Only point with this check is to make sure we don't try to perform
# the copy.
with pytest.raises(IOError, match="No such file or directory"):
with fs.working_dir(str(stage)):
fs.copy_tree('foo/ba', 'foo/bar')
def test_symlinks_true(self, stage): def test_symlinks_true(self, stage):
"""Test copying with symlink preservation.""" """Test copying with symlink preservation."""
@ -162,6 +202,31 @@ def test_symlinks_false(self, stage):
assert os.path.exists('dest/2') assert os.path.exists('dest/2')
assert not os.path.islink('dest/2') assert not os.path.islink('dest/2')
def test_glob_src(self, stage):
"""Test using a glob as the source."""
with fs.working_dir(str(stage)):
fs.copy_tree('source/g/*', 'dest')
assert os.path.exists('dest/i/8')
assert os.path.exists('dest/i/9')
assert os.path.exists('dest/j/10')
def test_non_existing_src(self, stage):
"""Test using a non-existing source."""
with fs.working_dir(str(stage)):
with pytest.raises(IOError, match='No such file or directory'):
fs.copy_tree('source/none', 'dest')
def test_parent_dir(self, stage):
"""Test source as a parent directory of destination."""
with fs.working_dir(str(stage)):
match = 'Cannot copy ancestor directory'
with pytest.raises(ValueError, match=match):
fs.copy_tree('source', 'source/sub/directory')
class TestInstallTree: class TestInstallTree:
"""Tests for ``filesystem.install_tree``""" """Tests for ``filesystem.install_tree``"""
@ -173,6 +238,7 @@ def test_existing_dir(self, stage):
fs.install_tree('source', 'dest') fs.install_tree('source', 'dest')
assert os.path.exists('dest/a/b/2') assert os.path.exists('dest/a/b/2')
check_added_exe_permissions('source/a/b/2', 'dest/a/b/2')
def test_non_existing_dir(self, stage): def test_non_existing_dir(self, stage):
"""Test installing to a non-existing directory.""" """Test installing to a non-existing directory."""
@ -181,6 +247,8 @@ def test_non_existing_dir(self, stage):
fs.install_tree('source', 'dest/sub/directory') fs.install_tree('source', 'dest/sub/directory')
assert os.path.exists('dest/sub/directory/a/b/2') assert os.path.exists('dest/sub/directory/a/b/2')
check_added_exe_permissions(
'source/a/b/2', 'dest/sub/directory/a/b/2')
def test_symlinks_true(self, stage): def test_symlinks_true(self, stage):
"""Test installing with symlink preservation.""" """Test installing with symlink preservation."""
@ -190,6 +258,7 @@ def test_symlinks_true(self, stage):
assert os.path.exists('dest/2') assert os.path.exists('dest/2')
assert os.path.islink('dest/2') assert os.path.islink('dest/2')
check_added_exe_permissions('source/2', 'dest/2')
def test_symlinks_false(self, stage): def test_symlinks_false(self, stage):
"""Test installing without symlink preservation.""" """Test installing without symlink preservation."""
@ -199,6 +268,35 @@ def test_symlinks_false(self, stage):
assert os.path.exists('dest/2') assert os.path.exists('dest/2')
assert not os.path.islink('dest/2') assert not os.path.islink('dest/2')
check_added_exe_permissions('source/2', 'dest/2')
def test_glob_src(self, stage):
"""Test using a glob as the source."""
with fs.working_dir(str(stage)):
fs.install_tree('source/g/*', 'dest')
assert os.path.exists('dest/i/8')
assert os.path.exists('dest/i/9')
assert os.path.exists('dest/j/10')
check_added_exe_permissions('source/g/h/i/8', 'dest/i/8')
check_added_exe_permissions('source/g/h/i/9', 'dest/i/9')
check_added_exe_permissions('source/g/i/j/10', 'dest/j/10')
def test_non_existing_src(self, stage):
"""Test using a non-existing source."""
with fs.working_dir(str(stage)):
with pytest.raises(IOError, match='No such file or directory'):
fs.install_tree('source/none', 'dest')
def test_parent_dir(self, stage):
"""Test source as a parent directory of destination."""
with fs.working_dir(str(stage)):
match = 'Cannot copy ancestor directory'
with pytest.raises(ValueError, match=match):
fs.install_tree('source', 'source/sub/directory')
def test_paths_containing_libs(dirs_with_libfiles): def test_paths_containing_libs(dirs_with_libfiles):

View File

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os import os
import sys import sys
@ -34,9 +32,7 @@ def install(self, spec, prefix):
mkdirp(prefix.lib) mkdirp(prefix.lib)
install(name, prefix.lib) install(name, prefix.lib)
mkdirp(prefix.include) mkdirp(prefix.include)
headers = glob.glob('*.h') install('*.h', prefix.include)
for h in headers:
install(h, prefix.include)
@run_after('install') @run_after('install')
def fix_darwin_install(self): def fix_darwin_install(self):

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Amrvis(MakefilePackage): class Amrvis(MakefilePackage):
"""Amrvis is a visualization package specifically designed to """Amrvis is a visualization package specifically designed to
@ -198,6 +195,4 @@ def setup_build_environment(self, env):
def install(self, spec, prefix): def install(self, spec, prefix):
# Install exe manually # Install exe manually
mkdirp(prefix.bin) mkdirp(prefix.bin)
exes = glob.iglob('*.ex') install('*.ex', prefix.bin)
for exe in exes:
install(exe, prefix.bin)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Aspa(MakefilePackage): class Aspa(MakefilePackage):
"""A fundamental premise in ExMatEx is that scale-bridging performed in """A fundamental premise in ExMatEx is that scale-bridging performed in
@ -52,5 +49,4 @@ def install(self, spec, prefix):
install('exec/kriging_model_centers.txt', prefix.input) install('exec/kriging_model_centers.txt', prefix.input)
install('exec/point_data.txt', prefix.input) install('exec/point_data.txt', prefix.input)
install('exec/value_data.txt', prefix.input) install('exec/value_data.txt', prefix.input)
for files in glob.glob('doc/*.*'): install('doc/*.*', prefix.doc)
install(files, prefix.doc)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Bcftools(AutotoolsPackage): class Bcftools(AutotoolsPackage):
"""BCFtools is a set of utilities that manipulate variant calls in the """BCFtools is a set of utilities that manipulate variant calls in the
@ -99,8 +96,7 @@ def install(self, spec, prefix):
if spec.satisfies('@1.2'): if spec.satisfies('@1.2'):
mkdirp(self.prefix.libexec.bcftools) mkdirp(self.prefix.libexec.bcftools)
for files in glob.glob('plugins/*.so'): install('plugins/*.so', self.prefix.libexec.bcftools)
install(files, self.prefix.libexec.bcftools)
@when('@1.2') @when('@1.2')
def setup_run_environment(self, env): def setup_run_environment(self, env):

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from glob import glob
class Bib2xhtml(Package): class Bib2xhtml(Package):
"""bib2xhtml is a program that converts BibTeX files into HTML.""" """bib2xhtml is a program that converts BibTeX files into HTML."""
@ -18,8 +15,7 @@ def install(self, spec, prefix):
# Add the bst include files to the install directory # Add the bst include files to the install directory
bst_include = join_path(prefix.share, 'bib2xhtml') bst_include = join_path(prefix.share, 'bib2xhtml')
mkdirp(bst_include) mkdirp(bst_include)
for bstfile in glob('html-*bst'): install('html-*bst', bst_include)
install(bstfile, bst_include)
# Install the script and point it at the user's favorite perl # Install the script and point it at the user's favorite perl
# and the bst include directory. # and the bst include directory.

View File

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import sys import sys
@ -115,9 +113,8 @@ def install_headers(self):
# grab the full binutils set of headers # grab the full binutils set of headers
install_tree('include', extradir) install_tree('include', extradir)
# also grab the headers from the bfd directory # also grab the headers from the bfd directory
for current_file in glob.glob(join_path(self.build_directory, install(join_path(self.build_directory, 'bfd', '*.h'),
'bfd', '*.h')): extradir)
install(current_file, extradir)
def flag_handler(self, name, flags): def flag_handler(self, name, flags):
# To ignore the errors of narrowing conversions for # To ignore the errors of narrowing conversions for

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from glob import glob
class Bowtie2(Package): class Bowtie2(Package):
"""Bowtie 2 is an ultrafast and memory-efficient tool for aligning """Bowtie 2 is an ultrafast and memory-efficient tool for aligning
@ -71,14 +68,4 @@ def install(self, spec, prefix):
make_arg.append('POPCNT_CAPABILITY=0') make_arg.append('POPCNT_CAPABILITY=0')
make(*make_arg) make(*make_arg)
mkdirp(prefix.bin) mkdirp(prefix.bin)
for bow in glob("bowtie2*"): install('bowtie2*', prefix.bin)
install(bow, prefix.bin)
# install('bowtie2',prefix.bin)
# install('bowtie2-align-l',prefix.bin)
# install('bowtie2-align-s',prefix.bin)
# install('bowtie2-build',prefix.bin)
# install('bowtie2-build-l',prefix.bin)
# install('bowtie2-build-s',prefix.bin)
# install('bowtie2-inspect',prefix.bin)
# install('bowtie2-inspect-l',prefix.bin)
# install('bowtie2-inspect-s',prefix.bin)

View File

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
import glob import glob
@ -48,10 +46,7 @@ def install(self, spec, prefix):
install_tree('example', prefix.example) install_tree('example', prefix.example)
with working_dir('scripts'): with working_dir('scripts'):
install('helpMod.pm', prefix.lib) install('helpMod.pm', prefix.lib)
files = glob.iglob('*.pl') install('*.pl', prefix.bin)
for file in files:
if os.path.isfile(file):
install(file, prefix.bin)
@run_after('install') @run_after('install')
def filter_sbang(self): def filter_sbang(self):

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Chombo(MakefilePackage): class Chombo(MakefilePackage):
"""The Chombo package provides a set of tools for implementing finite """The Chombo package provides a set of tools for implementing finite
@ -109,9 +106,7 @@ def build(self, spec, prefix):
def install(self, spec, prefix): def install(self, spec, prefix):
with working_dir('lib'): with working_dir('lib'):
install_tree('include', prefix.include) install_tree('include', prefix.include)
libfiles = glob.glob('lib*.a')
libfiles += glob.glob('lib*.so')
libfiles += glob.glob('lib*.dylib')
mkdirp(prefix.lib) mkdirp(prefix.lib)
for lib in libfiles: install('lib*.a', prefix.lib)
install(lib, prefix.lib) install('lib*.so', prefix.lib)
install('lib*.dylib', prefix.lib)

View File

@ -4,11 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Cloverleaf(MakefilePackage): class Cloverleaf(MakefilePackage):
"""Proxy Application. CloverLeaf is a miniapp that solves the """Proxy Application. CloverLeaf is a miniapp that solves the
compressible Euler equations on a Cartesian grid, compressible Euler equations on a Cartesian grid,
@ -95,7 +90,5 @@ def install(self, spec, prefix):
prefix.bin) prefix.bin)
install('CloverLeaf_{0}/clover.in'.format(self.type_of_build), install('CloverLeaf_{0}/clover.in'.format(self.type_of_build),
prefix.bin) prefix.bin)
install('CloverLeaf_{0}/*.in'.format(self.type_of_build),
for f in glob.glob( prefix.doc.tests)
'CloverLeaf_{0}/*.in'.format(self.type_of_build)):
install(f, prefix.doc.tests)

View File

@ -4,11 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Cloverleaf3d(MakefilePackage): class Cloverleaf3d(MakefilePackage):
"""Proxy Application. CloverLeaf3D is 3D version of the """Proxy Application. CloverLeaf3D is 3D version of the
CloverLeaf mini-app. CloverLeaf is a mini-app that solves CloverLeaf mini-app. CloverLeaf is a mini-app that solves
@ -78,7 +73,5 @@ def install(self, spec, prefix):
prefix.bin) prefix.bin)
install('CloverLeaf3D_{0}/clover.in'.format(self.type_of_build), install('CloverLeaf3D_{0}/clover.in'.format(self.type_of_build),
prefix.bin) prefix.bin)
install('CloverLeaf3D_{0}/*.in'.format(self.type_of_build),
for f in glob.glob( prefix.doc.samples)
'CloverLeaf3D_{0}/*.in'.format(self.type_of_build)):
install(f, prefix.doc.samples)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Cohmm(MakefilePackage): class Cohmm(MakefilePackage):
"""An anticipated important use-case for next-generation supercomputing """An anticipated important use-case for next-generation supercomputing
@ -37,5 +34,4 @@ def install(self, spec, prefix):
install('cohmm', prefix.bin) install('cohmm', prefix.bin)
install('README.md', prefix.doc) install('README.md', prefix.doc)
install('LICENSE.md', prefix.doc) install('LICENSE.md', prefix.doc)
for files in glob.glob('input/*.*'): install('input/*.*', prefix.input)
install(files, prefix.input)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Efivar(MakefilePackage): class Efivar(MakefilePackage):
"""Tools and libraries to work with EFI variables""" """Tools and libraries to work with EFI variables"""
@ -22,7 +19,5 @@ class Efivar(MakefilePackage):
def install(self, spec, prefix): def install(self, spec, prefix):
with working_dir(self.build_directory): with working_dir(self.build_directory):
mkdirp(prefix.lib) mkdirp(prefix.lib)
files = glob.glob('*.so*') install('*.so*', prefix.lib)
for f in files:
install(f, prefix.lib)
install_tree('include/efivar', prefix.include) install_tree('include/efivar', prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Exasp2(MakefilePackage): class Exasp2(MakefilePackage):
"""ExaSP2 is a reference implementation of typical linear algebra algorithms """ExaSP2 is a reference implementation of typical linear algebra algorithms
@ -70,7 +67,6 @@ def build_targets(self):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdir(prefix.bin) mkdir(prefix.bin)
mkdir(prefix.doc) mkdir(prefix.doc)
for files in glob.glob('bin/ExaSP2-*'): install('bin/ExaSP2-*', prefix.bin)
install(files, prefix.bin)
install('LICENSE.md', prefix.doc) install('LICENSE.md', prefix.doc)
install('README.md', prefix.doc) install('README.md', prefix.doc)

View File

@ -4,8 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path import os.path
import glob
from spack import *
class Gatk(Package): class Gatk(Package):
@ -61,8 +59,7 @@ def install(self, spec, prefix):
# For ver 3.x will install "GenomeAnalysisTK.jar" # For ver 3.x will install "GenomeAnalysisTK.jar"
# For ver 4.x will install both "gatk-package-<ver>-local.jar" # For ver 4.x will install both "gatk-package-<ver>-local.jar"
# and "gatk-package-<ver>-spark.jar" # and "gatk-package-<ver>-spark.jar"
for file in glob.glob("*.jar"): install("*.jar", prefix.bin)
install(file, prefix.bin)
# Skip helper script for versions >4.0 # Skip helper script for versions >4.0
if spec.satisfies("@4.0:"): if spec.satisfies("@4.0:"):

View File

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from glob import glob
import os import os
@ -39,5 +37,4 @@ def install(self, spec, prefix):
install('nanobenchmark_example', prefix.bin) install('nanobenchmark_example', prefix.bin)
install('vector_test', prefix.bin) install('vector_test', prefix.bin)
install('sip_hash_test', prefix.bin) install('sip_hash_test', prefix.bin)
for i in glob('highwayhash/*.h'): install('highwayhash/*.h', prefix.include)
install(i, prefix.include)

View File

@ -3,10 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os.path
class Hisat2(MakefilePackage): class Hisat2(MakefilePackage):
"""HISAT2 is a fast and sensitive alignment program for mapping """HISAT2 is a fast and sensitive alignment program for mapping
@ -40,10 +36,7 @@ def install(self, spec, prefix):
install('hisat2-inspect', prefix.bin) install('hisat2-inspect', prefix.bin)
install('hisat2-inspect-s', prefix.bin) install('hisat2-inspect-s', prefix.bin)
install('hisat2-inspect-l', prefix.bin) install('hisat2-inspect-l', prefix.bin)
files = glob.iglob('*.py') install('*.py', prefix.bin)
for file in files:
if os.path.isfile(file):
install(file, prefix.bin)
def setup_run_environment(self, env): def setup_run_environment(self, env):
env.prepend_path('PATH', self.spec.prefix) env.prepend_path('PATH', self.spec.prefix)

View File

@ -3,10 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os
class Hybpiper(Package): class Hybpiper(Package):
"""HybPiper was designed for targeted sequence capture, in which DNA """HybPiper was designed for targeted sequence capture, in which DNA
@ -36,7 +32,4 @@ def setup_run_environment(self, env):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.bin) mkdirp(prefix.bin)
files = glob.iglob("*.py") install('*.py', prefix.bin)
for file in files:
if os.path.isfile(file):
install(file, prefix.bin)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Iniparser(MakefilePackage): class Iniparser(MakefilePackage):
"""This modules offers parsing of ini files from the C level.""" """This modules offers parsing of ini files from the C level."""
@ -20,9 +17,6 @@ class Iniparser(MakefilePackage):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.include) mkdirp(prefix.include)
with working_dir('src'):
for files in glob.glob('*.h'):
install(files, prefix.include)
mkdirp(prefix.lib) mkdirp(prefix.lib)
for files in glob.glob('libiniparser.*'): install('src/*.h', prefix.include)
install(files, prefix.lib) install('libiniparser.*', prefix.lib)

View File

@ -205,13 +205,11 @@ def install(self, spec, prefix):
for lib_name in tbb_lib_names: for lib_name in tbb_lib_names:
# install release libs # install release libs
fs = glob.glob(join_path("build", "*release", lib_name + ".*")) install(join_path("build", "*release", lib_name + ".*"),
for f in fs: prefix.lib)
install(f, prefix.lib)
# install debug libs if they exist # install debug libs if they exist
fs = glob.glob(join_path("build", "*debug", lib_name + "_debug.*")) install(join_path("build", "*debug", lib_name + "_debug.*"),
for f in fs: prefix.lib)
install(f, prefix.lib)
if spec.satisfies('@2017.8,2018.1:', strict=True): if spec.satisfies('@2017.8,2018.1:', strict=True):
# Generate and install the CMake Config file. # Generate and install the CMake Config file.

View File

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os import os
@ -87,23 +85,17 @@ def install(self, spec, prefix):
mkdirp(prefix.lib) mkdirp(prefix.lib)
mkdirp(prefix.bin) mkdirp(prefix.bin)
libs = glob.glob(join_path('obj', 'lib*.a')) install(join_path('obj', 'lib*.a'), prefix.lib)
for lib in libs:
install(lib, prefix.lib)
# Build and install shared libxed.so and examples (to get the CLI). # Build and install shared libxed.so and examples (to get the CLI).
mfile('--clean') mfile('--clean')
mfile('examples', '--shared', *args) mfile('examples', '--shared', *args)
libs = glob.glob(join_path('obj', 'lib*.so')) install(join_path('obj', 'lib*.so'), prefix.lib)
for lib in libs:
install(lib, prefix.lib)
# Install the xed program # Install the xed program
install(join_path('obj', 'examples', 'xed'), prefix.bin) install(join_path('obj', 'examples', 'xed'), prefix.bin)
# Install header files. # Install header files.
hdrs = glob.glob(join_path('include', 'public', 'xed', '*.h')) \ install(join_path('include', 'public', 'xed', '*.h'), prefix.include)
+ glob.glob(join_path('obj', '*.h')) install(join_path('obj', '*.h'), prefix.include)
for hdr in hdrs:
install(hdr, prefix.include)

View File

@ -3,11 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
import os import os
from spack import *
class Ioapi(MakefilePackage): class Ioapi(MakefilePackage):
"""Models-3/EDSS Input/Output Applications Programming Interface.""" """Models-3/EDSS Input/Output Applications Programming Interface."""
@ -34,11 +31,7 @@ def install(self, spec, prefix):
make('install') make('install')
# Install the header files. # Install the header files.
mkdirp(prefix.include.fixed132) mkdirp(prefix.include.fixed132)
headers = glob.glob('ioapi/*.EXT') install('ioapi/*.EXT', prefix.include)
for header in headers:
install(header, prefix.include)
# Install the header files for CMAQ and SMOKE in the # Install the header files for CMAQ and SMOKE in the
# non-standard -ffixed-line-length-132 format. # non-standard -ffixed-line-length-132 format.
headers_fixed132 = glob.glob('ioapi/fixed_src/*.EXT') install('ioapi/fixed_src/*.EXT', prefix.include.fixed132)
for header in headers_fixed132:
install(header, prefix.include.fixed132)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Keyutils(MakefilePackage): class Keyutils(MakefilePackage):
"""These tools are used to control the key management system built """These tools are used to control the key management system built
@ -22,6 +19,4 @@ class Keyutils(MakefilePackage):
def install(self, spec, prefix): def install(self, spec, prefix):
install_tree('.', prefix) install_tree('.', prefix)
mkdirp(prefix.include) mkdirp(prefix.include)
headers = glob.glob(join_path(prefix, '*.h')) install(join_path(prefix, '*.h'), prefix.include)
for h in headers:
install(h, prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Leveldb(CMakePackage): class Leveldb(CMakePackage):
"""LevelDB is a fast key-value storage library written at Google """LevelDB is a fast key-value storage library written at Google
@ -52,13 +49,10 @@ def install(self, spec, prefix):
mkdirp(prefix.lib) mkdirp(prefix.lib)
# Needed for version 1.20 # Needed for version 1.20
libraries = glob.glob('out-shared/libleveldb.*') install('out-shared/libleveldb.*', prefix.lib)
libraries += glob.glob('out-static/libleveldb.*') install('out-static/libleveldb.*', prefix.lib)
# Needed for version 1.18 # Needed for version 1.18
libraries += glob.glob('libleveldb.*') install('libleveldb.*', prefix.lib)
for library in libraries:
install(library, prefix.lib)
install_tree('include', prefix.include) install_tree('include', prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Librom(AutotoolsPackage): class Librom(AutotoolsPackage):
"""libROM: library for computing large-scale reduced order models""" """libROM: library for computing large-scale reduced order models"""
@ -42,16 +39,15 @@ def configure_args(self):
# TODO(oxberry1@llnl.gov): Submit PR upstream that implements # TODO(oxberry1@llnl.gov): Submit PR upstream that implements
# install phase in autotools # install phase in autotools
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(self.spec.prefix.lib) mkdirp(prefix.lib)
install('libROM.a', join_path(self.spec.prefix.lib, 'libROM.a')) install('libROM.a', join_path(prefix.lib, 'libROM.a'))
mkdirp(self.spec.prefix.include) mkdirp(prefix.include)
for f in glob.glob('*.h'): install('*.h', prefix.include)
install(f, join_path(self.spec.prefix.include, f))
mkdirp(self.spec.prefix.share) mkdirp(prefix.share)
install('libROM_Design_and_Theory.pdf', install('libROM_Design_and_Theory.pdf',
join_path(self.spec.prefix.share, join_path(prefix.share,
'libROM_Design_and_Theory.pdf')) 'libROM_Design_and_Theory.pdf'))
install_tree('docs', self.spec.prefix.share.docs) install_tree('docs', prefix.share.docs)

View File

@ -113,10 +113,8 @@ def install(self, spec, prefix):
install_tree('bin', prefix.bin) install_tree('bin', prefix.bin)
mkdirp(prefix.doc) mkdirp(prefix.doc)
for doc_file in glob(join_path('documentation', '*.md')): install(join_path('documentation', '*.md'), prefix.doc)
install(doc_file, prefix.doc) install(join_path('documentation', '*.pdf'), prefix.doc)
for doc_file in glob(join_path('documentation', '*.pdf')):
install(doc_file, prefix.doc)
if '@1.8.2:' in spec: if '@1.8.2:' in spec:
install('LICENSE.md', prefix.doc) install('LICENSE.md', prefix.doc)
else: else:

View File

@ -5,7 +5,6 @@
from spack import * from spack import *
import glob
import sys import sys
import os import os
@ -101,8 +100,7 @@ def install(self, spec, prefix):
install('libmetis.a', prefix.lib) install('libmetis.a', prefix.lib)
mkdir(prefix.include) mkdir(prefix.include)
for h in glob.glob(join_path('Lib', '*.h')): install(join_path('Lib', '*.h'), prefix.include)
install(h, prefix.include)
mkdir(prefix.share) mkdir(prefix.share)
sharefiles = (('Graphs', '4elt.graph'), ('Graphs', 'metis.mesh'), sharefiles = (('Graphs', '4elt.graph'), ('Graphs', 'metis.mesh'),
@ -203,9 +201,7 @@ def install(self, spec, prefix):
# install GKlib headers, which will be needed for ParMETIS # install GKlib headers, which will be needed for ParMETIS
gklib_dist = join_path(prefix.include, 'GKlib') gklib_dist = join_path(prefix.include, 'GKlib')
mkdirp(gklib_dist) mkdirp(gklib_dist)
hfiles = glob.glob(join_path(source_directory, 'GKlib', '*.h')) install(join_path(source_directory, 'GKlib', '*.h'), gklib_dist)
for hfile in hfiles:
install(hfile, gklib_dist)
if self.run_tests: if self.run_tests:
# FIXME: On some systems, the installed binaries for METIS cannot # FIXME: On some systems, the installed binaries for METIS cannot

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Minigmg(Package): class Minigmg(Package):
"""miniGMG is a compact benchmark for understanding the performance """miniGMG is a compact benchmark for understanding the performance
@ -43,6 +40,4 @@ def install(self, spec, prefix):
mkdir(prefix.bin) mkdir(prefix.bin)
install('run.miniGMG', prefix.bin) install('run.miniGMG', prefix.bin)
mkdir(prefix.jobs) mkdir(prefix.jobs)
files = glob.glob('job*') install('job*', prefix.jobs)
for f in files:
install(f, prefix.jobs)

View File

@ -3,12 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
import tarfile import tarfile
from spack import *
class Minimd(MakefilePackage): class Minimd(MakefilePackage):
"""Proxy Application. A simple proxy for the force computations """Proxy Application. A simple proxy for the force computations
@ -52,6 +48,4 @@ def install(self, spec, prefix):
install('miniMD_ref/miniMD_mpi', prefix.bin) install('miniMD_ref/miniMD_mpi', prefix.bin)
install('miniMD_ref/in.lj.miniMD', prefix.bin) install('miniMD_ref/in.lj.miniMD', prefix.bin)
install('miniMD_ref/README', prefix.doc) install('miniMD_ref/README', prefix.doc)
install('miniMD_ref/in.*', prefix.doc)
for f in glob.glob('miniMD_ref/in.*'):
install(f, prefix.doc)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from glob import glob
class Motioncor2(Package): class Motioncor2(Package):
"""MotionCor2 is a multi-GPU program that corrects beam-induced sample """MotionCor2 is a multi-GPU program that corrects beam-induced sample
@ -34,7 +31,6 @@ class Motioncor2(Package):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.bin) mkdirp(prefix.bin)
for files in glob("MotionCor2_*"): install('MotionCor2_*', prefix.bin)
install(files, prefix.bin)
with working_dir(prefix.bin): with working_dir(prefix.bin):
symlink('MotionCor2_{0}'.format(spec.version), 'MotionCor2') symlink('MotionCor2_{0}'.format(spec.version), 'MotionCor2')

View File

@ -3,10 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os import os
import sys import sys
import glob
class Mumps(Package): class Mumps(Package):
@ -277,8 +275,7 @@ def install(self, spec, prefix):
lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so' lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
lib_suffix = lib_dsuffix if '+shared' in spec else '.a' lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
install('libseq/libmpiseq%s' % lib_suffix, prefix.lib) install('libseq/libmpiseq%s' % lib_suffix, prefix.lib)
for f in glob.glob(join_path('libseq', '*.h')): install(join_path('libseq', '*.h'), prefix.include)
install(f, prefix.include)
# FIXME: extend the tests to mpirun -np 2 when build with MPI # FIXME: extend the tests to mpirun -np 2 when build with MPI
# FIXME: use something like numdiff to compare output files # FIXME: use something like numdiff to compare output files

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Openmx(MakefilePackage): class Openmx(MakefilePackage):
"""OpenMX (Open source package for Material eXplorer) is a software """OpenMX (Open source package for Material eXplorer) is a software
@ -36,10 +33,7 @@ class Openmx(MakefilePackage):
def edit(self, spec, prefix): def edit(self, spec, prefix):
# Move contents to source/ # Move contents to source/
# http://www.openmx-square.org/bugfixed/18June12/README.txt # http://www.openmx-square.org/bugfixed/18June12/README.txt
patch_files = [] copy_tree('patch', 'source')
patch_files = glob.glob('./patch/*')
for f in patch_files:
copy(f, './source')
makefile = FileFilter('./source/makefile') makefile = FileFilter('./source/makefile')
makefile.filter('^DESTDIR.*$', 'DESTDIR = {0}/bin'.format(prefix)) makefile.filter('^DESTDIR.*$', 'DESTDIR = {0}/bin'.format(prefix))

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Opennurbs(Package): class Opennurbs(Package):
"""OpenNURBS is an open-source NURBS-based geometric modeling library """OpenNURBS is an open-source NURBS-based geometric modeling library
@ -49,6 +46,4 @@ def install(self, spec, prefix):
mkdir(prefix.include) mkdir(prefix.include)
install('libopenNURBS.a', prefix.lib) install('libopenNURBS.a', prefix.lib)
install_tree('zlib', join_path(prefix.include, 'zlib')) install_tree('zlib', join_path(prefix.include, 'zlib'))
headers = glob.glob(join_path('.', '*.h')) install('*.h', prefix.include)
for h in headers:
install(h, prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from glob import glob
class PerlStarFusion(Package): class PerlStarFusion(Package):
"""STAR-Fusion is a component of the Trinity Cancer Transcriptome Analysis """STAR-Fusion is a component of the Trinity Cancer Transcriptome Analysis
@ -29,12 +26,7 @@ class PerlStarFusion(Package):
depends_on('perl-uri', type=('build', 'run')) depends_on('perl-uri', type=('build', 'run'))
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.bin)
install('STAR-Fusion', prefix.bin)
mkdirp(perl_lib_dir) mkdirp(perl_lib_dir)
with working_dir('PerlLib'): install(join_path('PerlLib', '*.pm'), perl_lib_dir)
for pm in glob("*.pm"): install_tree('util', prefix.bin)
install(pm, perl_lib_dir) install('STAR-Fusion', prefix.bin)
with working_dir('util'):
for files in glob("*"):
install(files, prefix.bin)

View File

@ -4,11 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
# adapted from official quantum espresso package # adapted from official quantum espresso package
import glob
import os.path
from spack import *
class QESirius(Package): class QESirius(Package):
"""SIRIUS enabled fork of QuantumESPRESSO. """ """SIRIUS enabled fork of QuantumESPRESSO. """
@ -266,7 +261,7 @@ def install(self, spec, prefix):
# Compute the include directory from there: versions # Compute the include directory from there: versions
# of espresso prior to 6.1 requires -I in front of the directory # of espresso prior to 6.1 requires -I in front of the directory
elpa_include = '' if '@6.1:' in spec else '-I' elpa_include = '' if '@6.1:' in spec else '-I'
elpa_include += os.path.join( elpa_include += join_path(
elpa.headers.directories[0], elpa.headers.directories[0],
'modules' 'modules'
) )
@ -310,7 +305,6 @@ def install(self, spec, prefix):
if 'platform=darwin' in spec: if 'platform=darwin' in spec:
mkdirp(prefix.bin) mkdirp(prefix.bin)
for filename in glob.glob("bin/*.x"): install('bin/*.x', prefix.bin)
install(filename, prefix.bin)
else: else:
make('install') make('install')

View File

@ -3,11 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
import os.path
from spack import *
class QuantumEspresso(Package): class QuantumEspresso(Package):
"""Quantum ESPRESSO is an integrated suite of Open-Source computer codes """Quantum ESPRESSO is an integrated suite of Open-Source computer codes
@ -325,7 +320,7 @@ def install(self, spec, prefix):
# Compute the include directory from there: versions # Compute the include directory from there: versions
# of espresso prior to 6.1 requires -I in front of the directory # of espresso prior to 6.1 requires -I in front of the directory
elpa_include = '' if '@6.1:' in spec else '-I' elpa_include = '' if '@6.1:' in spec else '-I'
elpa_include += os.path.join( elpa_include += join_path(
elpa.headers.directories[0], elpa.headers.directories[0],
'modules' 'modules'
) )
@ -369,7 +364,6 @@ def install(self, spec, prefix):
if 'platform=darwin' in spec: if 'platform=darwin' in spec:
mkdirp(prefix.bin) mkdirp(prefix.bin)
for filename in glob.glob("bin/*.x"): install('bin/*.x', prefix.bin)
install(filename, prefix.bin)
else: else:
make('install') make('install')

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Redundans(Package): class Redundans(Package):
"""Redundans pipeline assists an assembly of heterozygous genomes.""" """Redundans pipeline assists an assembly of heterozygous genomes."""
@ -38,7 +35,6 @@ def install(self, spec, prefix):
'redundans.py') 'redundans.py')
binfiles = ['redundans.py', 'bin/filterReads.py'] binfiles = ['redundans.py', 'bin/filterReads.py']
binfiles.extend(glob.glob('bin/fast?2*.py'))
# new internal dep with 0.14a # new internal dep with 0.14a
if spec.satisfies('@0.14a:'): if spec.satisfies('@0.14a:'):
@ -47,3 +43,5 @@ def install(self, spec, prefix):
mkdirp(prefix.bin) mkdirp(prefix.bin)
for f in binfiles: for f in binfiles:
install(f, prefix.bin) install(f, prefix.bin)
install('bin/fast?2*.py', prefix.bin)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Rhash(MakefilePackage): class Rhash(MakefilePackage):
"""RHash is a console utility for computing and verifying hash sums of """RHash is a console utility for computing and verifying hash sums of
@ -52,8 +49,6 @@ def install(self, spec, prefix):
make('install-lib-static', 'DESTDIR={0}'.format(prefix), 'PREFIX=') make('install-lib-static', 'DESTDIR={0}'.format(prefix), 'PREFIX=')
if spec.satisfies('platform=darwin'): if spec.satisfies('platform=darwin'):
libs = glob.glob('librhash/*.dylib') install('librhash/*.dylib', prefix.lib)
for lib in libs:
install(lib, prefix.lib)
else: else:
make('install-lib-shared', 'DESTDIR={0}'.format(prefix), 'PREFIX=') make('install-lib-shared', 'DESTDIR={0}'.format(prefix), 'PREFIX=')

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class SnapKorf(MakefilePackage): class SnapKorf(MakefilePackage):
"""SNAP is a general purpose gene finding program suitable for both """SNAP is a general purpose gene finding program suitable for both
@ -30,9 +27,7 @@ def install(self, spec, prefix):
for p in progs: for p in progs:
install(p, prefix.bin) install(p, prefix.bin)
files = glob.iglob('*.pl') install('*.pl', prefix.bin)
for file in files:
install(file, prefix.bin)
install_tree('Zoe', prefix.Zoe) install_tree('Zoe', prefix.Zoe)
install_tree('HMM', prefix.HMM) install_tree('HMM', prefix.HMM)

View File

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Sparse(MakefilePackage): class Sparse(MakefilePackage):
@ -36,9 +34,7 @@ def build(self, spec, prefix):
make() make()
def install(self, spec, prefix): def install(self, spec, prefix):
headers = glob.glob('src/*.h') mkdir(prefix.include)
install_tree('lib', prefix.lib) install_tree('lib', prefix.lib)
install_tree('bin', prefix.bin) install_tree('bin', prefix.bin)
mkdir(prefix.include) install('src/*.h', prefix.include)
for h in headers:
install(h, prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Sse2neon(Package): class Sse2neon(Package):
"""A C/C++ header file that converts Intel SSE intrinsics to ARN NEON """A C/C++ header file that converts Intel SSE intrinsics to ARN NEON
@ -18,6 +15,4 @@ class Sse2neon(Package):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.include) mkdirp(prefix.include)
headers = glob.glob('*.h') install('*.h', prefix.include)
for f in headers:
install(f, prefix.include)

View File

@ -3,10 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os
class Superlu(Package): class Superlu(Package):
"""SuperLU is a general purpose library for the direct solution of large, """SuperLU is a general purpose library for the direct solution of large,
@ -64,9 +60,9 @@ def install(self, spec, prefix):
'ARCH = ar', 'ARCH = ar',
'ARCHFLAGS = cr', 'ARCHFLAGS = cr',
'RANLIB = {0}'.format('ranlib' if which('ranlib') else 'echo'), 'RANLIB = {0}'.format('ranlib' if which('ranlib') else 'echo'),
'CC = {0}'.format(os.environ['CC']), 'CC = {0}'.format(env['CC']),
'FORTRAN = {0}'.format(os.environ['FC']), 'FORTRAN = {0}'.format(env['FC']),
'LOADER = {0}'.format(os.environ['CC']), 'LOADER = {0}'.format(env['CC']),
'CDEFS = -DAdd_' 'CDEFS = -DAdd_'
]) ])
@ -95,7 +91,5 @@ def install(self, spec, prefix):
# Install manually # Install manually
install_tree('lib', prefix.lib) install_tree('lib', prefix.lib)
headers = glob.glob(join_path('SRC', '*.h'))
mkdir(prefix.include) mkdir(prefix.include)
for h in headers: install(join_path('SRC', '*.h'), prefix.include)
install(h, prefix.include)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Sw4lite(MakefilePackage): class Sw4lite(MakefilePackage):
"""Sw4lite is a bare bone version of SW4 intended for testing """Sw4lite is a bare bone version of SW4 intended for testing
@ -75,6 +72,5 @@ def build_targets(self):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdir(prefix.bin) mkdir(prefix.bin)
exe_name = glob.glob('*/sw4lite')[0] install('*/sw4lite', prefix.bin)
install(exe_name, prefix.bin)
install_tree('tests', prefix.tests) install_tree('tests', prefix.tests)

View File

@ -3,10 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os import os
import platform import platform
import glob
class Texlive(AutotoolsPackage): class Texlive(AutotoolsPackage):
@ -152,8 +150,7 @@ def configure_args(self):
def setup_texlive(self): def setup_texlive(self):
if not self.spec.satisfies('@live'): if not self.spec.satisfies('@live'):
mkdirp(self.prefix.tlpkg.TeXLive) mkdirp(self.prefix.tlpkg.TeXLive)
for files in glob.glob('texk/tests/TeXLive/*'): install('texk/tests/TeXLive/*', self.prefix.tlpkg.TeXLive)
install(files, self.prefix.tlpkg.TeXLive)
with working_dir('spack-build'): with working_dir('spack-build'):
make('texlinks') make('texlinks')

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Vardictjava(Package): class Vardictjava(Package):
"""VarDictJava is a variant discovery program written in Java. """VarDictJava is a variant discovery program written in Java.
@ -23,6 +20,4 @@ def install(self, spec, prefix):
install('bin/VarDict', prefix.bin) install('bin/VarDict', prefix.bin)
mkdirp(prefix.lib) mkdirp(prefix.lib)
files = [x for x in glob.glob("lib/*jar")] install('lib/*.jar', prefix.lib)
for f in files:
install(f, prefix.lib)

View File

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
class Wireshark(CMakePackage): class Wireshark(CMakePackage):
"""Graphical network analyzer and capture tool""" """Graphical network analyzer and capture tool"""
@ -99,6 +96,5 @@ def install_headers(self):
folders = ['.', 'epan/crypt', 'epan/dfilter', 'epan/dissectors', folders = ['.', 'epan/crypt', 'epan/dfilter', 'epan/dissectors',
'epan/ftypes', 'epan/wmem', 'wiretap', 'wsutil'] 'epan/ftypes', 'epan/wmem', 'wiretap', 'wsutil']
for folder in folders: for folder in folders:
headers = glob.glob(join_path(folder, '*.h')) install(join_path(folder, '*.h'),
for h in headers: join_path(prefix.include.wireshark, folder))
install(h, join_path(prefix.include, 'wireshark', folder))