# 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 RLpsolve(RPackage):
    """Lp_solve is freely available (under LGPL 2) software for solving
       linear, integer and mixed integer programs. In this
       implementation we supply a "wrapper" function in C and some R
       functions that solve general linear/integer problems, assignment
       problems, and transportation problems. This version calls
       lp_solve"""

    homepage = "https://cloud.r-project.org/package=lpSolve"
    url      = "https://cloud.r-project.org/src/contrib/lpSolve_5.6.13.tar.gz"
    list_url = "https://cloud.r-project.org/src/contrib/Archive/lpSolve"

    version('5.6.13.2', sha256='75f0c0af5cbdc219ac29c792342ecd625903632ad86e581c408879958aa88539')
    version('5.6.13.1', sha256='6ad8dc430f72a4698fc4a615bb5ecb73690b3c4520e84d9094af51a528f720b8')
    version('5.6.13', sha256='d5d41c53212dead4fd8e6425a9d3c5767cdc5feb19d768a4704116d791cf498d')

@@ -246,16 +246,85 @@
 %0A    %22%22%22
+Interface to 'Lp_solve' v. 5.5 to Solve Linear/Integer Programs%0A%0A    
 Lp_solve
@@ -383,23 +383,16 @@
 ving
-%0A      
  linear,
  int
@@ -387,16 +387,20 @@
  linear,
+%0A   
  integer
@@ -435,23 +435,16 @@
  In this
-%0A      
  impleme
@@ -462,16 +462,20 @@
 supply a
+%0A   
  %22wrappe
@@ -501,23 +501,16 @@
 d some R
-%0A      
  functio
@@ -530,16 +530,20 @@
  general
+%0A   
  linear/
@@ -570,23 +570,16 @@
 signment
-%0A      
  problem
@@ -609,16 +609,20 @@
 roblems.
+%0A   
  This ve
@@ -636,15 +636,8 @@
 alls
-%0A      
  lp_
@@ -860,16 +860,113 @@
 Solve%22%0A%0A
+    version('5.6.15', sha256='4627be4178abad34fc85a7d264c2eb5e27506f007e46687b0b8a4f8fbdf4f3ba')%0A
     vers

add version 5.6.15 to r-lpsolve (#21082)