summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/aspera-cli/package.py
blob: 51b0623aba2799917069697a028717f63283b165 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *
from glob import glob


class AsperaCli(Package):
    """The Aspera CLI client for the Fast and Secure Protocol (FASP)."""

    homepage = "https://asperasoft.com"
    url      = "https://download.asperasoft.com/download/sw/cli/3.7.7/aspera-cli-3.7.7.608.927cce8-linux-64-release.sh"

    version('3.7.7', 'e92140d809e7e65112a5d1cd49c442cf',
            url='https://download.asperasoft.com/download/sw/cli/3.7.7/aspera-cli-3.7.7.608.927cce8-linux-64-release.sh',
            expand=False)

    def setup_environment(self, spack_env, run_env):
        run_env.prepend_path('PATH', self.prefix.cli.bin)

    def install(self, spec, prefix):
        runfile = glob(join_path(self.stage.path, 'aspera-cli*.sh'))[0]
        # Update destination path
        filter_file('INSTALL_DIR=~/.aspera',
                    'INSTALL_DIR=%s' % prefix,
                    runfile,
                    string=True)
        # Install
        chmod = which('chmod')
        chmod('+x', runfile)
        runfile = which(runfile)
        runfile()