{% set version = '0.2.0' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/semver_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/semver/semver_{{ version }}.tar.gz
  sha256: becfaa6c422970298916f5157539bf8510ba26c4000b1bf51a3d32a1ab9f9783

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-rcpp >=0.12.8
    - r-assertthat
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.12.8
    - r-assertthat

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

about:
  home: https://github.com/johndharrison/semver

  license: MIT
  summary: Tools and functions for parsing, rendering and operating on semantic version strings.
    Semantic versioning is a simple set of rules and requirements that dictate how version
    numbers are assigned and incremented as outlined at <http://semver.org>.

  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

extra:
  recipe-maintainers:
    - ocefpaf
