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

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

source:
  fn: incadata_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/incadata_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/incadata/incadata_{{ version }}.tar.gz
  sha256: 009fa3b3cfd822da2bb1a928d58e522c75c4afeac1902b017a9c0be4e03f40aa

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-backports
    - r-decoder
    - r-dplyr
    - r-rccmisc
    - r-rvest
    - r-sweidnumbr
    - r-xml2
  run:
    - r-base
    - r-backports
    - r-decoder
    - r-dplyr
    - r-rccmisc
    - r-rvest
    - r-sweidnumbr
    - r-xml2

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

about:
  home: https://www.bitbucket.org/cancercentrum/incadata
  license: GPL-2
  summary: ' Handle data in formats used by cancer centers in Sweden, both from ''INCA''  (the
    current register platform, (see <http://rcc.incanet.se> for more  information) and  by
    the older register platform ''Rockan'' (used in the Western and Northern part  of
    the country).  All variables are coerced to suitable classes based on their  format.  Dates
    (from various formats such as with missing month or day, with or  without century
    prefix or with just a week number) are all recognized as dates and coerced to the
    ISO 8601 standard (Y-m-d). Boolean variables (internally stored either as 0/1 or
    "True"/"False"/blanks  when exported) are coerced to logical.  Variable names ending
    in ''_Beskrivning'' and ''_Varde'' will be character,  and ''PERSNR'' will be coerced
    (if possible) to a valid personal identification  number ''pin'' (by the ''sweidnumbr''
    package). The package also allow the user to interactively choose if a variable
    should  be coerced into a potential format even though not all of its values might  conform
    to the recognized pattern. It also contain a caching mechanism in order to temporarily
    store data sets  with its newly decided formats in order to not rerun the identification  process
    each time.  And finally, it also include a mechanism to aid the documentation process  connected
    to projects build on data from ''INCA''.'
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
