{% set version = '0.6-6' %}

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

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

source:
  fn: gsubfn_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gsubfn_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gsubfn/gsubfn_{{ version }}.tar.gz
  sha256: bbc5d29bb48e836407f81880aeb368544a54a5513dacb3411c9838180723dda4

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

requirements:
  build:
    - r-base
    - r-proto
  run:
    - r-base
    - r-proto

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

about:
  home: http://gsubfn.googlecode.com
  license: GPL (>= 2)
  summary: |
    gsubfn is like gsub but can take a replacement function or certain other objects instead
    of the replacement string. Matches and back references are input to the replacement
    function and  replaced by the function output.   gsubfn can be used to split strings  based
    on content rather than delimiters and for quasi-perl-style string  interpolation.
    The package also has facilities for translating formulas  to functions and allowing
    such formulas in function calls instead of  functions.  This can be used with R
    functions such as apply, sapply, lapply, optim, integrate, xyplot, Filter and any
    other function that  expects another function as an input argument or functions
    like cat or sql calls that may involve strings where substitution is desirable.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
