spack/var/spack/repos/builtin/packages/g4ndl/package.py
Patrick Gartung 9cf6aece85
Geant4 data packages: Set the install path name explicitly. (#12244)
* Geant4 data packages: Set the install path name explicitly.

* Use the correct directory name for g4photonevaporation,g4radioactivedecay,g4realsurface
2019-08-02 13:48:35 -05:00

26 lines
962 B
Python

# 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 *
class G4ndl(Package):
"""Geant4 Neutron data files with thermal cross sections """
homepage = "http://geant4.web.cern.ch"
url = "http://geant4-data.web.cern.ch/geant4-data/datasets/G4NDL.4.5.tar.gz"
version('4.5', 'cba928a520a788f2bc8229c7ef57f83d0934bb0c6a18c31ef05ef4865edcdf8e')
def install(self, spec, prefix):
mkdirp(join_path(prefix.share, 'data'))
install_path = join_path(prefix.share, 'data', 'G4NDL{0}'
.format(self.version))
install_tree(self.stage.source_path, install_path)
def url_for_version(self, version):
"""Handle version string."""
return ("http://geant4-data.web.cern.ch/geant4-data/datasets/G4NDL.%s.tar.gz" % version)