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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/filelock_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/filelock/filelock_{{ version }}.tar.gz
  sha256: ac2915950789b16c43a625a2b8dab6ba423588db4a7d0daa75b74518b82b1403

build:
  merge_build_host: True  # [win]
  number: 1002
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

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

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

about:
  home: https://github.com/r-lib/filelock#readme
  license: MIT
  summary: Place an exclusive or shared lock on a file. It uses 'LockFile' on Windows and 'fcntl'
    locks on Unix-like systems.
  license_family: MIT
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'

extra:
  recipe-maintainers:
    - conda-forge/r
    - halldc
