{% set version = '3.0-2' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-grpreg
  version: {{ version|replace("-", "_") }}

source:
  fn: grpreg_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/grpreg_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/grpreg/grpreg_{{ version }}.tar.gz
  sha256: 12111d8ecb45974070a22ac6998155cc67935b49d88b358f5eaaa0f2833dd8f0

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-matrix
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-matrix
    - libgcc  # [not win]

test:
  commands:
    - $R -e "library('grpreg')"  # [not win]
    - "\"%R%\" -e \"library('grpreg')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=grpreg
  license: GPL-3
  summary: Efficient algorithms for fitting the regularization path of linear or logistic regression
    models with grouped penalties.  This includes group selection methods such as group
    lasso, group MCP, and group SCAD as well as bi-level selection methods such as the
    group exponential lasso, the composite MCP, and the group bridge.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
