# Copyright 2013-2021 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 RGetoptlong(RPackage):
    """This is yet another command-line argument parser which wraps the
       powerful Perl module Getopt::Long and with some adaptation for easier
       use in R. It also provides a simple way for variable interpolation in
       R."""

    homepage = "https://cloud.r-project.org/package=GetoptLong"
    url      = "https://cloud.r-project.org/src/contrib/GetoptLong_0.1.6.tar.gz"
    list_url = "https://cloud.r-project.org/src/contrib/Archive/GetoptLong"

    version('0.1.7', sha256='b9a98881db407eae9b711c4fa9170168fd5f3be1f8485cd8f28d0a60ace083ba')
    version('0.1.6', sha256='f526f006e3ed8507f1f236430ac9e97341c1ee9c207fbb68f936dd4d377b28b5')

    depends_on('r@3.0.0:', type=('build', 'run'))
    depends_on('r-rjson', type=('build', 'run'))
    depends_on('r-globaloptions@0.1.0:', type=('build', 'run'))

    # The CRAN site lists SystemRequirments as: Perl, Getopt::Long. The
    # Getop::Long package will be installed with Perl so just depend on perl.
    depends_on('perl')

@@ -249,16 +249,86 @@
 %0A    %22%22%22
+Parsing Command-Line Arguments and Simple Variable Interpolation%0A%0A    
 This is 
@@ -383,23 +383,16 @@
 raps the
-%0A      
  powerfu
@@ -392,16 +392,20 @@
 powerful
+%0A   
  Perl mo
@@ -457,23 +457,16 @@
 r easier
-%0A      
  use in 
@@ -470,16 +470,20 @@
 in R. It
+%0A   
  also pr
@@ -535,15 +535,8 @@
 n in
-%0A      
  R.%22
@@ -761,16 +761,112 @@
 tLong%22%0A%0A
+    version('1.0.5', sha256='8c237986ed3dfb72d956ad865ef7768644eebf144675ad66140acfd1aca9d701')%0A
     vers
@@ -1092,32 +1092,98 @@
 build', 'run'))%0A
+    depends_on('r@3.3.0:', when='@1.0.5:', type=('build', 'run'))%0A
     depends_on('
@@ -1278,16 +1278,82 @@
  'run'))
+%0A    depends_on('r-crayon', when='@1.0.5:', type=('build', 'run'))
 %0A%0A    # 

add version 1.0.5 to r-getoptlong (#20988)